mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中)。 例如下面这个sql:
复制代码 代码如下:
delete from tbl where id in ( select max(id) from tbl a where EXISTS ( select 1 from tbl b where a.tac=b.tac group by tac HAVING count(1)>1 ) group by tac )
改写成下面就行了:
复制代码 代码如下:
delete from tbl where id in ( select a.id from ( select max(id) id from tbl a where EXISTS ( select 1 from tbl b where a.tac=b.tac group by tac HAVING count(1)>1 ) group by tac ) a )
mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法mysql “ Every derived table must have its own alias”出现错误解决办法读取mysql一个库下面的所有的表tableMySQL无法重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法mysql Event Scheduler: Failed to open table mysql.event出现错误mysql Table ''performance_schema...解决办法