577 员工奖金
(1)题目描述
选出所有bonus < 1000 的员工的name及其bonus。
(2)具体实现
# Write your MySQL query statement below
# left join + null
select name, bonus
from Employee left join Bonus on Employee.empId = Bonus.empId
# where bonus is null or bonus < 1000;
where ifnull(bonus,0)<1000;
(3)总结
- 左外连接及其他关联查询使用条件;
- 记录为空的处理操作。
- 狗言狗语:今天生大气又大彻大悟 后遗症:头痛哦。