You can't specify target table 'Person' for update in FROM clause
2017-04-20 15:03
411 查看
mysql中调用下面的语句提示该错误
delete from Person where id in ( select t1.id from Person t1, Person t2 where t1.email = t2.email and t1.id > t2.id );
In MySQL, you can’t modify the same table which you use in the SELECT part.
解决方法:
建立一张临时的中间表
delete from Person where id in ( select id from( select t1.id as id from Person t1, Person t2 where t1.email = t2.email and t1.id > t2.id ) as tmp );
相关文章推荐
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- You can't specify target table 't' for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- [Err] 1093 - You can't specify target table 'image' for update in FROM clause
- MySQL数据库update更新子查询[Err] 1093 - You can't specify target table 'text' for update in FROM clause
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- You can't specify target table 'tableName' for update in FROM clause
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- mysql中You can't specify target table for update in FROM clause错误 转
- MySQL报错“ you can't specify the target table for ‘update’ in from clause”
- [Err] 1093 - You can't specify target table 'table' for update in FROM clause处理
- mysql中的一个特殊问题:You can’t specify target table ‘abc’ for update in FROM clause
- mysql 一个较特殊的问题:You can't specify target table 'wms_cabinet_form' for update in FROM clause
- mysql Error Code: 1093. You can't specify target table 'base_extend' for update in FROM clause 0.001
- [Django](1093, "You can't specify target table 'fee_details_invoices' for update in FROM clause") 错误
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- [Err] 1093 - You can't specify target table 's' for update in FROM clause
- mysql中You can’t specify target table for update in FROM clause错误解决方法