| Rush |
Posted: Feb 21, 2007 04:36:06 AM |
Total Post: 127
Joined: Jan, 2007
|
there is a table
proc_id quantity price state
------- -------- ----- -------
1 10 100 delhi
... ... ... UP
like this data are there. i want to take data item wise state wise total sales.plz show the right way.i have used group by in various forms but it doesn't work.
RUPESH
gullu02@gmail.com |
|
|
suzee |
| Posted: Feb 21, 2007 07:27:32 AM | |
|
Total Post: 21
Joined: Feb, 2007
|
try ur qurey with groupby cube(column1,column2,column3)
select sum(column1),column2,column3 from tablename
where..........
groupby cube(column1,column2,column3);
|
|
|
|
|
Rush |
| Posted: Feb 21, 2007 11:58:37 PM | |
|
Total Post: 127
Joined: Jan, 2007
|
thanks Suzee!!thanks a lot :-) i have done that qury using groub by cube as you told me.it's working and i knew one new thing that how to take more than one colunm in group by using cube.
thanks again!!!!
RUPESH
gullu02@gmail.com
|
|
|
|
|
Ghulam |
| Posted: Feb 22, 2007 03:05:51 AM | |
|
Total Post: 8
Joined: Feb, 2007
|
Dear. Can you send me the code u tried for group by function
Thanks
|
|
|
|
|
Rush |
| Posted: Feb 22, 2007 06:08:34 AM | |
|
Total Post: 127
Joined: Jan, 2007
|
DEAR GHULAM THAT CODE WAS LIKE THIS....
select item_code,state,sum(qty*price) from
invoice
group by cube(item_code,state);
plz.. note that there are following columns in invoice table
item_code,qty,price,state.
Rupesh
|
|
|
|
|
Ghulam |
| Posted: Feb 22, 2007 07:17:02 AM | |
|
Total Post: 8
Joined: Feb, 2007
|
Thanks Rush.
Its great!!!!!
Its because I did my OCA 10g but never heard about CUBE statement in group functions....lol
|
|
|
|
|
suzee |
| Posted: Feb 22, 2007 08:27:09 AM | |
|
Total Post: 21
Joined: Feb, 2007
|
|
|
|
|
ranju |
| Posted: Mar 07, 2007 12:46:44 AM | |
|
Total Post: 1
Joined: Mar, 2007
|
Dear ghulam!
i want to know more about OCA-developer certification as iam planning for the same
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |