题解 | #获取有奖金的员工相关信息。#

获取有奖金的员工相关信息。

https://www.nowcoder.com/practice/5cdbf1dcbe8d4c689020b6b2743820bf

with tb1 as(
    select emp_no, salary
    from salaries
    where to_date='9999-01-01')

select emp_no, first_name, last_name, btype, salary, 
case when btype=1 then round(0.1*salary,1)
when btype=2 then round(0.2*salary,1)
else round(0.3*salary,1) end as bonus
from tb1 right join emp_bonus using(emp_no)
left join employees using(emp_no)
order by tb1.emp_no

全部评论

相关推荐

不愿透露姓名的神秘牛友
11-16 01:46
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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