题解 | #获取有奖金的员工相关信息。#
获取有奖金的员工相关信息。
https://www.nowcoder.com/practice/5cdbf1dcbe8d4c689020b6b2743820bf
select emp_no,
first_name,
last_name,
btype,
salary,
case when btype=1 then round(salary*0.1,1)
when btype=2 then round(salary*0.2,1)
else salary*0.3
end as bonus
from employees
left join emp_bonus using(emp_no)
right join salaries using(emp_no)
where btype is not null and to_date='9999-01-01'
order by emp_no
查看5道真题和解析
联想公司福利 1481人发布