Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> GROUP BY QUESTION
Hi, I think there should be an easy answer for my problem???
I have this data
cust no cust prod dollar ------- --------- --- 1 A 10 1 B 10 1 C 10
I need to do a sum of dollar based on cust no and i want to put something in the cust_prod column when i roll up, but if i include cust_prod in my select, then the GROUP BY requires all fields in the select to be in the GROUP BY....preventing it from rolling up. ultimately i would like the data to be
Cust no cust prod dollar ------ --------- ------ 1 A or B or C $30
I just need to fill cust prod with one of the values...it doesn't matter
which one..
the sql i used is..
select
cust_no, cust_prod, SUM(dollar)
I would appreciate any ideas..
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 Fri May 28 1999 - 16:51:48 CDT