题解 | #获取有奖金的员工相关信息。#
获取有奖金的员工相关信息。
http://www.nowcoder.com/practice/5cdbf1dcbe8d4c689020b6b2743820bf
SELECT e.emp_no, e.first_name, e.last_name, b.btype, s.salary, CASE WHEN b.btype = 1 THEN s.salary*0.1 WHEN b.btype = 2 THEN s.salary*0.2 ELSE s.salary*0.3 END AS 'bonus' FROM employees e, emp_bonus b, salaries s WHERE s.to_date='9999-01-01' AND e.emp_no=b.emp_no AND e.emp_no=s.emp_no;