mysql You can't specify target table for update in FROM clause解决方法
来源:互联网 发布:长城宽带续费网络网址 编辑:程序博客网 时间:2024/06/08 14:55
mysql You can't specify target table for update in FROM clause解决方法出现这个错误的原因是不能在同一个sql语句中,先select同一个表的某些值,然后再update这个表。mysql> update message set content='Hello World' where id in(select min(id) from message group by uid);ERROR 1093 (HY000): You can't specify target table 'message' for update in FROM clause因为在同一个sql语句中,先select出message表中每个用户消息的最小id值,然后再更新message表,因此会出现 ERROR 1093 (HY000): You can’t specify target table ‘message’ for update in FROM clause 这个错误。 解决方法:select的结果再通过一个中间表select多一次,就可以避免这个错误update message set content='Hello World' where id in( select min_id from ( select min(id) as min_id from message group by uid) as a );
查看原文:http://newmiracle.cn/?p=1780
阅读全文
0 0
- MySQL "You can't specify target table 'X' 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 <tbl> 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错误:1093-You can’t specify target table for update in FROM clause的解决方法
- mysql update语句问题:You can't specify target table 'user' for update in FROM clause
- MySql报错: You can't specify target table 'table name' for update in FROM clause
- 【MySQL】1093 You can't specify target table 'table name' for update in FROM clause
- Mysql - You can't specify target table 'dataproduct' for update in FROM clause
- MySQL报错“ you can't specify the target table for ‘update’ in from clause”
- mysql中You can't specify target table for update in FROM clause错误
- java基础2
- Zond 265使用教程
- IO中同步异步阻塞非阻塞的区别
- 发生系统错误 1219。不允许一个用户使用一个以上用户名与服务器或共享资源的多重连接。
- 409. Longest Palindrome的C++算法
- mysql You can't specify target table for update in FROM clause解决方法
- 利用swiper快速打造web的轮播图
- iOS-关于.a静态库开发的一些注意事项
- HDU 动态规划经典题
- 【微信公众号开发】自我学习第六章:微信回复天气问题
- BZOJ 绝世好题(DP)
- html的input的type为number时,maxlenght无效
- Leetcode: 128. Longest Consecutive Sequence
- ecjtu-summer training #1 A(CodeForces 651A)