MySQL 中发生 You can't specify target table '表名' for update in FROM clause

好像只有在 mysql 中有此限制,解决方法就是不要在 update 的 where 语句中直接使用 select 子查询,再嵌套一层就可以了。。。

例如:update tablename set xx=0 where id in (select id from (select id from anothertable) as t)

原文地址:https://www.cnblogs.com/xwgli/p/12713085.html