题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取每个部门中当前员工薪水最高的相关信息
https://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
select
temp.dept_no,dept_emp.emp_no,salary
from
salaries,dept_emp,
(
select
d.dept_no,
max(salary) maxSalary
from
dept_emp d,
salaries s
where
d.emp_no = s.emp_no
group by
dept_no
) as temp
where
salary = temp.maxSalary and dept_emp.emp_no=salaries.emp_no