-
SQL Query That Uses both DECODE & SUM
I am looking for assistance with a SQL query that will
i) Do a Sum on a numeric field
ii) Group by say category down the side and transpose by month across the top.
I have been looking at DECODE and I do not have problems using the count function with a date mask however I am stuck with doing a SUM.
My table looks as follows
CAT DATE QTY
a 01/01/2007 40
a 21/01/2007 30
a 01/02/2007 50
b 01/01/2007 80
b 15/01/2007 60
b 08/02/2007 40
I would like it to come out as
JAN FEB
a 70 50
b 140 40
I would like to avoid PL/SQL
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|