Code:
Connected to:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Producti
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
SQL> SELECT * FROM your_table;
ID WHO MONEY
---------- -------------------- ----------
1 Henry 10
2 John 5
3 John 10
4 Mario 20
SQL> SELECT id, who, SUM(money) FROM your_table
2 GROUP BY rollup(who, id);
ID WHO SUM(MONEY)
---------- -------------------- ----------
1 Henry 10
Henry 10
2 John 5
3 John 10
John 15
4 Mario 20
Mario 20
45
8 rows selected.
Those rows in bold are subtotals (the last one is grandtotal) that were added by ROLLUP.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?