题解 | #获取员工其当前的薪水比其manager当前薪水还高的相关信息#
获取员工其当前的薪水比其manager当前薪水还高的相关信息
http://www.nowcoder.com/practice/f858d74a030e48da8e0f69e21be63bef
select b.emp_no,a.emp_no manager_no,b.salary emp_salary,a.salary manager_salary from (select d.dept_no,d.emp_no,s.salary from dept_manager d join salaries s on d.emp_no=s.emp_no)a //领导工资表 join (select d.dept_no,d.emp_no,s.salary from dept_emp d join salaries s on d.emp_no=s.emp_no)b //员工工资表 on a.dept_no=b.dept_no where b.salary>a.salary;