Oracle学习之查询语句
select deptno,job,avg(sal) from emp group by deptno,job order by deptno; select deptno,job,avg(sal) from emp group by cube (deptno,job) order by deptno; select deptno,job,sum(sal),grouping(deptno),grouping(job) from emp group by rollup(deptno,job) order by deptno; select deptno,job,sum(sal) from emp group by rollup((deptno,job)); select deptno,job,sum(sal) from emp group by cube((deptno,job)); select deptno,job,mgr,sum(sal) from emp group by grouping sets(deptno),grouping sets(job,mgr); select deptno,job,avg(sal) from emp group by grouping sets(deptno,job); select deptno,job,mgr,sum(sal) from emp group by deptno,rollup(job,mgr); select deptno,job,mgr,sum(sal) from emp group by deptno,cube(job,mgr);