题目描述
将所有获取奖金的员工当前的薪水增加10%。
create table emp_bonus(
emp_no int not null,
recevied datetime not null,
btype smallint not null);
CREATE TABLE `salaries` (
`emp_no` int(11) NOT NULL,
`salary` int(11) NOT NULL,
`from_date` date NOT NULL,
`to_date` date NOT NULL, PRIMARY KEY (`emp_no`,`from_date`));
UPDATE salaries
SET salary = (1.1 * salary)
WHERE salaries.emp_no IN
(SELECT emp_no FROM emp_bonus);
如下连接表然后再更新表的信息居然又死在了SQLite手上
UPDATE salaries JOIN emp_bonus ON salaries.emp_no=emp_bonus.emp_no
SET salaries.salary= (1.1*salary);