题解 | 获取员工其当前的薪水比其manager当前薪水还高的相关信息
select es.emp_no, ms.manager_no, es.salary, ms.salary from (SELECT dm.emp_no manager_no, s.salary salary, dm.dept_no dept_no FROM dept_manager dm left join salaries s on dm.emp_no = s.emp_no where s.to_date = '9999-01-01' ) ms right join (select de.emp_no emp_no, s.salary salary, de.dept_no dept_no from dept_emp de left join salaries s on de.emp_no = s.emp_no where s.to_date = '9999-01-01' ) es on ms.dept_no = es.dept_no where es.salary > ms.salary