Oracle数据库中的rollup配合group by命令使用可以提供信息汇总功能(与小计相似) 示例如下 SQL> select jobdeptnosal from emp; JOB DEPTNO SAL CLERK SALESMAN SALESMAN MANAGER SALESMAN MANAGER MANAGER ANALYST PRESIDENT SALESMAN CLERK CLERK ANALYST CLERK 已选择行 SQL> select jobdeptnosum(sal) total_sal from emp group by rollup(jobdeptno); JOB DEPTNO TOTAL_SAL ANALYST ANALYST CLERK CLERK CLERK CLERK MANAGER MANAGER MANAGER MANAGER PRESIDENT PRESIDENT SALESMAN SALESMAN
已选择行 SQL> |