SQL> select
2 dept_id,years,sum( salary )
3 from emp01
4 group by rollup( dept_id, years );
DEPT_ID YEARS SUM(SALARY)
------ ---------- -----------
D01 3 150
D01 150 −−−− 小計
D02 3 600
D02 7 600
D02 1200 −−−− 小計
D03 3 500
D03 7 300
D03 800 −−−− 小計
2150 −−−− 合計 |