Sum from employees implicit sorting using the union operator
412 Chapter 9: Using the Set Operators
|
![]() |
|---|
SELECT department_id dept, NULL mgr, sum(salary) FROM employees
GROUP BY department_id
UNION
SELECT NULL, manager_id, sum(salary)
FROM employees
GROUP BY manager_id
UNION
SELECT NULL, NULL, sum(salary)
FROM employees;
|
![]() |
|---|




