题解 | #查找在职员工自入职以来的薪水涨幅情况#
查找在职员工自入职以来的薪水涨幅情况
http://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5
直接三连,LEFT JOIN 统计个数
SELECT d.dept_no,de.dept_name,COUNT(d.dept_no) as sum FROM salaries as s LEFT JOIN dept_emp as d ON s.emp_no = d.emp_no LEFT JOIN departments as de ON d.dept_no = de.dept_no GROUP BY d.dept_no ORDER BY d.dept_no