select job, deptno, sum(sal)
from emp
group by job, deptno;
select job, deptno, sum(sal)
from emp
group by rollup(job, deptno);
추가적인 집계정보를 보여준다.
select job, deptno, sum(sal)
from emp
group by job, rollup(deptno);
JOB별로 추가적인 집계정보를 보여준다.
select job, deptno, sum(sal)
from emp
group by deptno, rollup(job);
deptno별로 추가적인 집계정보를 보여준다.
select job, deptno, sum(sal)
from emp
group by job, deptno;
select job, deptno, sum(sal)
from emp
group by cube(job, deptno);
가능한 모든 조합별로 집계한 결과를 반환한다.
select job, deptno, sum(sal)
from emp
group by job, deptno;
select job, deptno, sum(sal)
from emp
group by GROUPING SETS(JOB, DEPTNO);
JOB별 합계, DEPTNO별 합계만 조회되었다
즉, ((GROUP BY ex1) UNION ALL(GROUP BY ex2) UNION ALL(GROUP BY ex3))형태가 된다.