题解 | #获取有奖金的员工相关信息。#
获取有奖金的员工相关信息。
https://www.nowcoder.com/practice/5cdbf1dcbe8d4c689020b6b2743820bf
select b.emp_no,first_name,last_name,btype,salary, round((case when btype=1 then 0.1 when btype=2 then 0.2 else 0.3 end)*salary,1) bonus from emp_bonus b left join salaries s on b.emp_no=s.emp_no left join employees e on b.emp_no=e.emp_no where to_date='9999-01-01' order by emp_no