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: G Quesnel <dbaguy_ott_at_yahoo.com>
Date: 8 Jun 2005 09:28:32 -0700
Message-ID: <1118248112.034140.233790@f14g2000cwb.googlegroups.com>


Take a look at the rollup and cube option on the group by. Something like ...
Select f1,f2,count(*) from table group by cube(f1,f2); or
Select f1,f2,f3,max(f4),count(*)
 from table group by f1, f2, g3;

This last example is just to show you that you can (must) group by all columns in the select clause which are not part of a aggregate function, such as max or count, when you use the group by clause.

HTH Received on Wed Jun 08 2005 - 11:28:32 CDT

Original text of this message

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