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

京公网安备 11010502036488号