题解 | 获取员工其当前的薪水比其manager当前薪水还高的相关信息
获取员工其当前的薪水比其manager当前薪水还高的相关信息
https://www.nowcoder.com/practice/f858d74a030e48da8e0f69e21be63bef
select a.emp_no,b.emp_no,a.salary,b.salary from (select de.dept_no,de.emp_no,s.salary from dept_emp de left join salaries s on s.emp_no = de.emp_no where de.to_date ='9999-01-01' and s.to_date ='9999-01-01')a join (select dm.dept_no,dm.emp_no,s.salary from dept_manager dm left join salaries s on s.emp_no = dm.emp_no where dm.to_date ='9999-01-01' and s.to_date ='9999-01-01')b on a.salary>b.salary and a.dept_no = b.dept_no 思路分别查出部门经理工资和所有人工资,再进行链接,部门相等,薪资对比

查看8道真题和解析