题解 | #统计各个部门的工资记录数#
统计各个部门的工资记录数
http://www.nowcoder.com/practice/6a62b6c0a7324350a6d9959fa7c21db3
select a.dept_no,a.dept_name,(count(c.emp_no)) sum
from departments a
inner join dept_emp b on a.dept_no=b.dept_no
inner join salaries c on c.emp_no=b.emp_no
group by a.dept_no
order by a.dept_no