rollup 配合 goup by 命令使用,可以提供信息匯總功能(類似於"小計")
下面是一個簡單例子:
SQL> select job,deptno,sal from emp;
JOB DEPTNO SAL
--------- --------- ---------
CLERK 20 800
SALESMAN 30 1600
SALESMAN 30 1250
MANAGER 20 2975
SALESMAN 30 1250
MANAGER 30 2850
MANAGER 10 2450
ANALYST 20 3000
PRESIDENT 10 5000
SALESMAN 30 1500
CLERK 20 1100
CLERK 30 950
ANALYST &nbs