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