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 -> Re: Group by question ...

Re: Group by question ...

From: Brian Peasland <oracle_dba_at_peasland.com>
Date: Tue, 5 Nov 2002 15:15:55 GMT
Message-ID: <3DC7E0AB.11F65813@peasland.com>


> I want to do
>
> SELECT A,B,C,D,E, sum(F) from Table group by A || B || C;
>
> It's not possible because A isn't a group by expression ! ok
> Is a way exists to do this ?

Since your aggregate function is only on F, then all other columns need to be in the GROUP BY clause.

SELECT a,b,c,d,e,SUM(f) FROM table GROUP BY a,b,c,d,e;

There is no such thing as "GROUP BY A||B||C". If you group by all five columns, then surely you have grouped by the concatenation of three, plus the other two. Are you sure that you don't mean ORDER BY?????

Cheers,
Brian Received on Tue Nov 05 2002 - 09:15:55 CST

Original text of this message

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