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 -> GROUP BY QUESTION

GROUP BY QUESTION

From: <yarch_at_hotmail.com>
Date: Sun, 30 May 1999 14:04:26 GMT
Message-ID: <7irghb$q3f$1@nnrp1.deja.com>


Hi,
I need help with group by in my sql.
I have the following data

cust no cust prod amt
------ --------- ---

1            A          10
1            B          10
1            C          10

I need to SUM up on cust no and include one of the cust prod (anyone).. like this

cust no    cust prod     amt
-------    ---------     ---
1          A or B or C    30

This is the sql below.

select cust no, cust prod , amt
from .....
where cust no = 1
group by cust no

This doesn't work because I need to include cust prod in my group by list......and if i do that, it won't sum up to the cust no level.. it will sum up to the cust prod level......

I would appreciate any suggestions..
Thanks
Mike
yarch_at_hotmail.com

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Sun May 30 1999 - 09:04:26 CDT

Original text of this message

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