select e.emp_no ,f.emp_no as manager_no ,e.salary as emp_salary ,f.salary as manager_salary from (select c.emp_no # step1:非管理人员薪水 ,c.dept_no ,d.salary ,c.from_date ,c.to_date from dept_emp c inner join salaries d on c.emp_no=d.emp_no) e left join # step3:用部门编号left join step1 和 step2 的结果 (select a.dept_no ,a.emp_no # step2:管理人员薪水 ,b.salary ,a.from_date ,a.to_date from dept_manager a inner join salaries b on a.emp_no=b.emp_no) f on e.dept_no=f.dept_no where e.salary>f.salary # step4:where 条件为非管理人员薪水>管理人员薪水