题解 | #统计各个部门的工资记录数#
统计各个部门的工资记录数
http://www.nowcoder.com/practice/6a62b6c0a7324350a6d9959fa7c21db3
select t1.dept_no, t1.dept_name, COUNT(t3.salary) as sum from departments t1 JOIN dept_emp t2 on t1.dept_no=t2.dept_no join salaries t3 on t2.emp_no=t3.emp_no group by t1.dept_no order by t1.dept_no asc