题解 | 获取当前员工薪水高于管理者
获取员工其当前的薪水比其manager当前薪水还高的相关信息
https://www.nowcoder.com/practice/f858d74a030e48da8e0f69e21be63bef
select a.de_no, a.dm_no, a.de_salary, s2.salary as dm_salary from ( select de.emp_no as de_no, s.salary as de_salary, dm.dept_no as dm_dept, dm.emp_no as dm_no from dept_emp as de left join dept_manager as dm on de.dept_no = dm.dept_no left join salaries as s on de.emp_no =s.emp_no) a left join salaries as s2 on a.dm_no = s2.emp_no where a.de_salary > s2.salary
有点粗暴但是做出来了