Hi,
Would it be possible to use SQL to display the data below in the following format? The only clause I could partially figure out using is group by rollup. What other SQL clauses do I have to use to display the output in the desired format?
create table emp (id number, name varchar2(10), dept number, salary number, bonus number);
insert into emp values (3,'MILLY',2,5000,50);
insert into emp values (5,'JANE',1,10000,10);
insert into emp values (1,'JILL',1,1000,1);
insert into emp values (2,'LILY',2,6000,60);
insert into emp values (4,'GEORGE',2,4000,40);
commit;
DEPT ID NAME SUM(SALARY) SUM(BONUS)
----------- ---------- -------- ------------ ----------
1 1 JILL 1000 1
5 JANE 10000 10
Subtotal 11000 11
2 2 LILY 6000 60
3 MILLY 5000 50
4 GEORGE 4000 40
Subtotal 15000 150
TOTAL 26000 161
Thanks.