mysql中You can't specify target table for update in FROM clause错误
2017-08-07 14:55
585 查看
mysql中You can’t specify target table for update in FROM clause错误意思你不可以对某个表现进行select,然后根据select出来的值再进行操作。比如:
解决方案是对select出来的结果进行一次包装:如下
这样就ok了
update tbl t set t.name = 'xxx' where id in ( select max(id) from tbl a where EXISTS ( select 1 from tbl b where a.tac=b.tac group by xx ) group by xx )
解决方案是对select出来的结果进行一次包装:如下
update tbl t set t.name = 'xxx' where id in ( select * from ( select max(id) from tbl a where EXISTS ( select 1 from tbl b where a.tac=b.tac group by xx ) group by xx ) tmp )
这样就ok了
相关文章推荐
- MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause
- mysql 出现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 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 错误码: 1093 You can't specify target table 'jc_user' 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错误 转
- 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错误
- Mysql 错误 Code: 1093. You can't specify target table for update in FROM clause