select t1.emp_no,t2.emp_no as manager_no,t1.salary as emp_salary,t2.salary as manager_salary
from (select de.emp_no,de.dept_no,s.salary from dept_emp de join salaries s on de.emp_no=s.emp_no ) t1 --员工工资
join
(select dm.emp_no,dm.dept_no,s.salary from dept_manager dm join salaries s on dm.emp_no=s.emp_no) t2
on t1.dept_no=t2.dept_no and t1.salary>t2.salary;
--查出员工薪水表
--查出经理薪水表
--做连接