group by절
/* 전체 집계도 '전체'라고 조회되지만 부서ID가 null인 부서의 집계도 '전체'라고 조회됨 */
select decode(department_id, null, '전체', department_id), count(*)
from employees
group by rollup(department_id);
select decode(grouping(department_id), 1, '전체', department_id), count(*)
from employees
group by rollup(department_id);
Reference