题解 | 窗口函数方法
获取每个部门中当前员工薪水最高的相关信息
https://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
with t as(select de.dept_no, de.emp_no, s.salary, max(s.salary) over (partition by de.dept_no) as maxSalary from dept_emp de left join salaries s on de.emp_no = s.emp_no) select dept_no,emp_no,maxSalary from t where salary=maxSalary;