题解 | 获取每个部门中薪水最高的员工相关信息
select dept_no ,emp_no ,salary from(select dept_no ,emp_no ,salary ,max(salary)over(partition by dept_no ) max_Salary from dept_emp d join salaries using(emp_no)) t where salary=max_Salary order by dept_no
select dept_no ,emp_no ,salary from(select dept_no ,emp_no ,salary ,max(salary)over(partition by dept_no ) max_Salary from dept_emp d join salaries using(emp_no)) t where salary=max_Salary order by dept_no
相关推荐