select t.emp_no, e.first_name, e.last_name, btype, t.salary, round(eb.btype * t.salary * 0.1, 1) bonus from emp_bonus eb left join ( select emp_no, salary from salaries where to_date = '9999-01-01' ...