Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> how to use count(*) in "group by" queries

how to use count(*) in "group by" queries

From: renozu <renozu_at_yahoo.com>
Date: 21 Nov 2006 07:30:50 -0800
Message-ID: <1164123050.180204.93230@h54g2000cwb.googlegroups.com>


I am trying to use count(*) to prevent queries from executing that are blowing out memory. The query comes in two forms:
(1) select a, b, c, d from x, y, z where...;
which I can count first like this:
select count(*) from x,y,z where...; ==> easy enough

The other form is:
(2) select count(*), a, b, max(c), max(d) from x,y,z where... group by
a,b;
this query already has a count(*), which counts the number of rows in each group. How can I count the number of groups that will be returned without actually doing the full query?

Thanks,
Martin Received on Tue Nov 21 2006 - 09:30:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US