WITH 절
WITH 절 이해하기 좋은 예제 SELECT e.name AS employee_name, dc1.dept_count AS emp_dept_count, m.name AS manager_name, dc2.dept_count AS mgr_dept_countFROM employee e, (SELECT dept_id, COUNT(*) AS dept_count FROM employee GROUP BY dept_id) dc1, employee m, (SELECT dept_id, COUNT(*) AS dept_count FROM employee GROUP BY dept_id) dc2 WHERE e.dept_id = dc1.dept_id AND e.manager_id = m.idAND m.dept_id = dc2.dep..
Oracle/DB
2016. 4. 6. 16:09