MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause
来源:互联网 发布:淘宝模板代码怎么关闭 编辑:程序博客网 时间:2024/06/07 13:39
当执行以下sql语句时会出现 Error Code:1093 错误:
update car set tag = 1 where id in (select id from car where brand_id=182 and tag=0);
出现错误的原因是因为修改的表和查询的表是同一个表,MySQL是不允许这样做的,我们可以通过中间再查询一次来解决:
update car set tag = 1 where id in (select id from (select id from car where brand_id=182 and tag=0) As temp);
1 0
- MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause
- Mysql 错误 Code: 1093. 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
- mysql执行SQL语句时,出现You can't specify target table '表名' for update in FROM clause错误
- mysql SQL语句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 中 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错误解决方法
- actionScriptProperties linkType
- SPFA 邻接表模式
- 递推递归练习 A
- 阿里云服务器(CentOS 7.0)如何更改服务器主机名称以及安装配置JDK、Tomcat和Mysql
- 实验吧安全杂项WP(六)
- MySQL中执行sql语句错误 Error Code: 1093. You can't specify target table 'car' for update in FROM clause
- sqlConnection连接不上sql 2000 原来是因为没有打补丁sp4
- 各种网页错误代码解释(400.404.504等) (感觉总结的很全,转过来看看)
- 卸载了curl后yum不能使用,libcurl.so.4: cannot open shared object file: No such file or directory
- jquery中append、prepend, before和after方法的区别(一)
- header中Content-Disposition的作用 用于浏览器不打开图片直接下载
- Android N/7.X新特性——在下拉设定里加个摇骰子(TileService的使用)
- java编程题:将某个时间以固定格式转化成字符串
- Spark(一): 基本架构及原理