题解 | #两种方法# 错题整理
将所有获取奖金的员工当前的薪水增加10%
http://www.nowcoder.com/practice/d3b058dcc94147e09352eb76f93b3274
-- solution 1:子查询
UPDATE salaries s
SET salary = salary * 1.1
WHERE s.to_date = '9999-01-01'
AND s.emp_no in (SELECT emp_no FROM emp_bonus)
-- solution 2:JOIN
# UPDATE salaries s
# JOIN emp_bonus eb
# USING (emp_no)
# SET salary = salary * 1.1
# WHERE to_date = '9999-01-01'