一个用相关子查询的例子 SELECT de.emp_no, dm.emp_no, s.salary, (select s.salary from salaries s left join dept_manager dm on dm.emp_no=s.emp_no where dm.dept_no=de.dept_no LIMIT 1) as manager_salary

from dept_emp de LEFT join salaries s on s.emp_no=de.emp_no LEFT join dept_manager dm on dm.dept_no=de.dept_no

where s.salary>(select s.salary from salaries s left join dept_manager dm on dm.dept_no=de.dept_no where s.emp_no=dm.emp_no LIMIT 1)