将员工表和经理表分别与薪水表连接,选出员工薪水大于经理薪水的记录
SELECT s1.emp_no,s2.emp_no manager_no,s1.salary emp_salary,s2.salary manager_salary
FROM (salaries s1 JOIN dept_emp de ON s1.emp_no = de.emp_no)
JOIN (salaries s2 JOIN dept_manager dm ON s2.emp_no = dm.emp_no)
ON de.dept_no = dm.dept_no
WHERE s1.salary > s2.salary