题解 | #查找当前薪水详情以及部门编号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;

全部评论

相关推荐

2025-12-31 14:31
湖南科技大学 Web前端
是阿亮吖:一个是这个时间招人比较少,另一个是沟通太少了。六十多份太养生了,最起码沟通个五六百份吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务