Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> SQL Question, taking differences between sum of columns
Hi,
I have following table structure, tbl1( type_code varchar2(100), val
integer)
having data as:
Type Val --------- -------------- G1 10 G1 23 G2 22 G2 21 G3 43 G4 11 G4 33 G5 44
I would like to perform calculation such as ((sum(G1) + sum(G2)) - sum(G3)
And further more ((sum(G1) + sum(G2)) - sum(G3) * sum(G4)
Any help would be appriciated,
Thanks,
Anil G
Received on Tue Jul 11 2006 - 23:13:38 CDT