题解 | #获取员工其当前的薪水比其manager#
获取员工其当前的薪水比其manager当前薪水还高的相关信息
https://www.nowcoder.com/practice/f858d74a030e48da8e0f69e21be63bef
select a.emp_no,b.emp_no,c.salary,d.salary from dept_emp a left join dept_manager b on a.dept_no = b.dept_no left join salaries c on a.emp_no = c.emp_no left join salaries d on b.emp_no = d.emp_no where c.salary > d.salary
薪水表需要关联两次,一次是关联员工,一次是关联主管