MySQL数据库update更新子查询[Err] 1093 - You can't specify target table 'text' for update in FROM clause
来源:互联网 发布:php实现注册登录 编辑:程序博客网 时间:2024/05/01 05:31
比如:
UPDATE test.tb_vobile aset a.name = '111 'WHEREa.id = (select max(id) id from test.tb_vobile)
报错:
[SQL]UPDATE test.tb_vobile aset a.name = '111 'WHEREa.id = (select max(id) id from test.tb_vobile) [Err] 1093 - You can't specify target table 'a' for update in FROM clause
以下可通过:
UPDATE test.tb_vobile ajoin(select max(id) id from test.tb_vobile) bon a.id = b.idset a.name = '123 ';或 UPDATE test.tb_vobile a ,(select max(id) id from test.tb_vobile) bset a.name = '321 'WHEREa.id = b.id ;
说明:
1、update 时,更新的表不能在set和where中用于子查询;
2、update 时,可以对多个表进行更新(sqlserver不行);
如:update ta a,tb b set a.Bid=b.id ,b.Aid=a.id;
3、update 后面可以做任意的查询,这个作用等同于from;
0 0
- MySQL数据库update更新子查询[Err] 1093 - You can't specify target table 'text' for update in FROM clause
- [Err] 1093 - You can't specify target table 'table' for update in FROM clause处理
- [Err] 1093 - You can't specify target table 's' for update in FROM clause
- [Err] 1093 - You can't specify target table 'image' for update in FROM clause
- 【MySQL】1093 You can't specify target table 'table name' for update in FROM clause
- MYSQL 临时表 #1093 - You can't specify target table 'dealer_admin' 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 'jc_user' 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
- [Err] 1093 - You can't specify target table 'matorder' for update in FROM clause 原句:delete from mat
- MySql报错: 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错误
- MySQL "You can't specify target table 'X' for update in FROM clause" 错误解决方法
- Mysql 错误 Code: 1093. You can't specify target table for update in FROM clause
- mysql中You can't specify target table for update in FROM clause错误
- Mybatis 大数据量的批量insert解决方案
- Centos下Tomcat以指定的用户,非root权限开机自启
- iOS应用版本更新
- html DOM操作表格及样式
- 对char **argv的理解(多级指针)
- MySQL数据库update更新子查询[Err] 1093 - You can't specify target table 'text' for update in FROM clause
- Oracle统计信息
- Mongodb-1
- 不让浏览器缓存js
- iOS 绘制虚线
- HTML DOM Table 对象
- sql中exists,not exists的用法
- GDB调试php扩展错误(Segmentation fault (core dumped))
- Swift快速入门(一)基本类型