mysql删除数据库重复数据,#1093 - You can't specify target table 'blur_article' for update in FROM clause 错误解决方
2014-05-29 13:03
399 查看
在Mysql下执行: delete from blur_article where id not in(select min(id) from blur_article group by title) 用途是去重复标题,但是却报错! #1093 - You can't specify target table 'blur_article' for update in FROM clause 在Mysql下执行: select * from blur_article where id not in(select min(id) from blur_article group by title) 执行查询语句却显示成功! 怎么回事呀,如果上面的delete不能执行,有没有别的sql可以做这样的操作?
我是想做一个去重复操作,比如说: 字段 id title 1 张三 2 李四 3 张三 4 王五 5 李四 最终结果是 id title 1 张三 2 李四 4 王五 mysql中不能这么用。 (等待mysql升级吧) 错误提示就是说,不能先select出同一表中的某些值,再update这个表(在同一语句中) 替换方案: create table tmp as select min(id) as col1 from blur_article group by title; delete from blur_article where id not in (select col1 from tmp); drop table tmp; 已经测试,尽请使用
相关文章推荐
- MySQL "You can't specify target table 'X' for update in FROM clause" 错误解决方法
- [Django](1093, "You can't specify target table 'fee_details_invoices' for update in FROM clause") 错误
- (原)mysql错误1093 You can't specify target table 'wms_cabinet_form' for update in FROM clause
- mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法
- MYSQL 1093 - You can't specify target table '' for update in FROM clause
- MYSQL 临时表 #1093 - You can't specify target table 'dealer_admin' for update in FROM clause
- ERROR 1093 (HY000): You can't specify target table 'b' for update in FROM clause
- mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法
- mysql错误:1093-You can’t specify target table for update in FROM clause的解决方法
- 解决mysql不能修改(You can't specify target table 'basic_data' 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 target table 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错误解决方法
- You can't specify target table 'A' for update in FROM clause
- mysql 一个较特殊的问题:You can't specify target table 'wms_cabinet_form' for update in FROM clause
- mysql 一个较特殊的问题:You can't specify target table 'wms_cabinet_form' for update in FROM clause
- You can't specify target table 'table_name' for update in FROM clause
- mysql中You can’t specify target table for update in FROM clause错误解决方法