方法一:三个表连续连接,考察了if嵌套或者是CASE When select b.emp_no,b.first_name,b.last_name,c.btype,t.salary,round(if(c.btype=1,t.salary0.1,if(c.btype=2,t.salary0.2,t.salary*0.3)),1) as bonus from salaries as t join emp_bonus as c on t.emp_no=c.emp_no and t.to_date="9999-01-01" join employees as b on b.emp_no=t.emp_no...