Oracle數據庫中的rollup配合group by命令使用
示例如下
SQL> select job
JOB DEPTNO SAL
CLERK
SALESMAN
SALESMAN
MANAGER
SALESMAN
MANAGER
MANAGER
ANALYST
PRESIDENT
SALESMAN
CLERK
CLERK
ANALYST
CLERK
已選擇
SQL> select job
from emp group by rollup(job
JOB DEPTNO TOTAL_SAL
ANALYST
ANALYST
CLERK
CLERK
CLERK
CLERK
MANAGER
MANAGER
MANAGER
MANAGER
PRESIDENT
PRESIDENT
SALESMAN
SALESMAN
已選擇
SQL>
From:http://tw.wingwit.com/Article/program/SQL/201311/16203.html