通过子查询单独查询出manager的薪水。貌似写的有点复杂
获取员工其当前的薪水比其manager当前薪水还高的相关信息
https://www.nowcoder.com/practice/f858d74a030e48da8e0f69e21be63bef
SELECT de.emp_no, t1.manager_no, s.salary AS emp_salary, t1.manager_salary FROM dept_emp de LEFT JOIN salaries s ON de.emp_no = s.emp_no LEFT JOIN ( SELECT dm.dept_no, dm.emp_no AS manager_no, s.salary AS manager_salary FROM dept_manager dm JOIN salaries s ON dm.emp_no = s.emp_no )t1 ON de.dept_no = t1.dept_no WHERE s.salary > t1.manager_salary