select e.name, b.bonus
from employee as e left join bonus as b on e.empId = b.empId
where b.bonus < 1000 or b.bonus is null
null需要用is或is not来进行判断
本文介绍如何使用SQL查询从employee表中筛选出奖金小于1000元或者奖金为null的员工,通过left join与bonus表结合,展示empName和bonus信息。
select e.name, b.bonus
from employee as e left join bonus as b on e.empId = b.empId
where b.bonus < 1000 or b.bonus is null
null需要用is或is not来进行判断
800
1308
2000
1927

被折叠的 条评论
为什么被折叠?