题解 | #汇总各个部门当前员工的title类型的分配数目#
汇总各个部门当前员工的title类型的分配数目
http://www.nowcoder.com/practice/4bcb6a7d3e39423291d2f7bdbbff87f8
SELECT d.dept_no, dept_name, title, count(*)
FROM departments d, dept_emp de, titles t
WHERE d.dept_no = de.dept_no AND
de.emp_no = t.emp_no
GROUP BY title, dept_name
ORDER BY dept_no, title;