Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Group by question ...
> 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