题解 | #获取员工其当前的薪水比其manager当前薪水还高的相关信息#
获取员工其当前的薪水比其manager当前薪水还高的相关信息
http://www.nowcoder.com/practice/f858d74a030e48da8e0f69e21be63bef
-- emp_no != manager.emp_no && salary>manager.salary
select a.emp_no,c.emp_no manager_no,b.salary emp_salary,c.salary manager_salary from dept_emp a left join salaries b on a.emp_no =b.emp_no left join (select v.emp_no,v.dept_no,x.salary from dept_manager v left join salaries x on v.emp_no=x.emp_no) c on a.dept_no =c.dept_no where b.salary >c.salary and b.emp_no not in (select emp_no from dept_manager);