题解 | #查找当前薪水详情以及部门编号dept_no#

查找当前薪水详情以及部门编号dept_no

https://www.nowcoder.com/practice/c63c5b54d86e4c6d880e4834bfd70c3b

/* select
s.emp_no
,s.salary
,s.from_date
,s.to_date
,d.dept_no
from 
salaries s left join dept_manager d on s.emp_no =d.emp_no
where d.dept_no is not null 
and s.to_date='9999-01-01'
and d.to_date='9999-01-01'
*/













select
s.emp_no
,s.salary
,s.from_date
,s.to_date
,d.dept_no
from salaries s left join dept_manager d
on s.emp_no = d.emp_no
where s.emp_no in (select emp_no from dept_manager ) #manager的emp_no
order by s.emp_no asc













全部评论

相关推荐

01-15 13:52
已编辑
河南大学 Java
六年要多久:标准头像,不吃香菜😂
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务