4
在安全模式下删除mysql
我有一位表讲师,我想删除工资范围在一定范围内的记录。一种直观的方式是这样的: delete from instructor where salary between 13000 and 15000; 但是,在安全模式下,如果不提供主键(ID),则无法删除记录。 所以我写下面的sql: delete from instructor where ID in (select ID from instructor where salary between 13000 and 15000); 但是,有一个错误: You can't specify target table 'instructor' for update in FROM clause 我很困惑,因为当我写 select * from instructor where ID in (select ID …