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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get different columns total in one time query?

Re: How to get different columns total in one time query?

From: IANAL_VISTA <IANAL_Vista_at_hotmail.com>
Date: Wed, 08 Jun 2005 15:52:47 GMT
Message-ID: <Xns966F5A54A551FSunnySD@68.6.19.6>


"RK" <rekaben_at_yahoo.com> wrote in
news:1118245120.906496.257230_at_f14g2000cwb.googlegroups.com:

>
> Hi, can someone help me, please?
>
> I have a big table with two different fields f1 and f2, there are many
> many different combinations of these two fields values.
>
> Now I need to do this:
>
> select f1, count(*) from table group by f1;
> select f2, count(*) from table group by f2;
>
> Each count may take long time. Can I run one query on the two fields,
> and still get separate total counts of the different field-values, with
> SQL*Plus only?
>

Yes, but neither query above does what you say you want. Both will give the same value for count. You might want to try using the DISTINCT qualifier. Received on Wed Jun 08 2005 - 10:52:47 CDT

Original text of this message

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