题解 | #获取所有非manager员工当前的薪水情况#
获取所有非manager员工当前的薪水情况
http://www.nowcoder.com/practice/8fe212a6c71b42de9c15c56ce354bebe
先找出是manager的员工, 然后使用not in排除他们
select d.dept_no, e.emp_no, s.salary
from employees e
left join dept_emp d
on e.emp_no=d.emp_no
left join salaries s
on e.emp_no=s.emp_no
where e.emp_no not in
(select emp_no from dept_manager);
from employees e
left join dept_emp d
on e.emp_no=d.emp_no
left join salaries s
on e.emp_no=s.emp_no
where e.emp_no not in
(select emp_no from dept_manager);