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