题目应该说得更明白些:选出有奖金的员工信息。下面代码如果用left join就会错是因为保留了其他员工。
select emp_no, first_name, last_name, btype, salary,
case when btype=1 then salary*0.1
when btype=2 then salary*0.2
else salary*0.3 end bonus
from
(select emp_no, salary from salaries where to_date='9999-01-01') as tb1
join emp_bonus using(emp_no)
join employees using(emp_no)