题解 | #获取所有非manager员工当前的薪水情况#
获取所有非manager员工当前的薪水情况
http://www.nowcoder.com/practice/8fe212a6c71b42de9c15c56ce354bebe
思路:先筛选不是manager的员工,合并salary,再次合并department-employee表得到department number
select d.dept_no, new2.emp_no, new2.salary from (select new.dept_no as dept_no, new.emp_no as emp_no, s.salary as salary from (select * from employees e left join dept_manager m
on e.emp_no = m.emp_no
where m.dept_no is null) as new left join salaries s
on new.emp_no = s.emp_no) as new2 left join dept_emp d
on new2.emp_no = d.emp_no