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

方法一:使用左连接 left join (注意剔除dept_no 为None的值)
select a.last_name,a.first_name,b.dept_no
from employees a left join dept_emp b
on a.emp_no = b.emp_no
where b.dept_no not null;

方法二:使用内连接 inner join (内连接是自动连接有值的数据,空值的不会显示)
select a.last_name,a.first_name,b.dept_no
from employees a inner join dept_emp b
on a.emp_no = b.emp_no
where b.dept_no not null;

全部评论

相关推荐

01-07 07:54
已编辑
门头沟学院 前端工程师
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务