题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取每个部门中当前员工薪水最高的相关信息
http://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
SELECT d.dept_no, d.emp_no, s.salary AS 'maxSalary' FROM dept_emp AS d JOIN salaries AS s ON d.emp_no = s.emp_no GROUP BY dept_no HAVING salary = MAX(salary) ORDER BY d.dept_no ASC