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 -> SQL Question, taking differences between sum of columns

SQL Question, taking differences between sum of columns

From: Anil G <anil.gothal_at_gmail.com>
Date: 11 Jul 2006 21:13:38 -0700
Message-ID: <1152677618.455745.141320@s13g2000cwa.googlegroups.com>


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

Original text of this message

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