Though this is not in the same format as you expect, but gives the required result... Individual total, total on days and grand total..
SameerCode:SQL>l 1 SELECT subscriber_name, 2 DECODE(to_char(datum,'D'),1,'Mon',2,'Tue',3,'Wed',4,'Thu',5,'Fri',6,'Sat',7,'Sun', 'To 3 SUM(hours) hours 4 FROM subscriber 5* GROUP BY CUBE (subscriber_name, to_char(datum,'D')) SQL> / SUBSCRIBER DAY HOURS ---------- ------ ---------- Joe Mon 8 Tue 2 Wed 3 Thu 7 Fri 4 Sat 8 Sun 1 Total 33 John Mon 2 Tue 5 Wed 3 Thu 7 Fri 1 Sat 9 Sun 4 Total 31 Lis Mon 15 Tue 1 Wed 13 Thu 8 Fri 2 Sat 17 Sun 3 Total 59 Martin Mon 5 Tue 1 Wed 3 Thu 8 Fri 2 Sat 7 Sun 3 Total 29 Mon 30 Tue 9 Wed 22 Thu 30 Fri 9 Sat 41 Sun 11 Total 152 40 rows selected. SQL>




Reply With Quote