mysql异常:You can't specify target table 'my' for update in FROM clause
来源:互联网 发布:老外网络视频教英语 编辑:程序博客网 时间:2024/05/16 11:49
如果需要数据库中的数据与现有的数据进行操作
在mysql中,需要在查询原有数据时,需要将其作为中间表然后进行操作.
oracle则不需要
举例 :
表结构
如下是错误的
INSERT INTO my (id, iden, NAME, age)VALUES ( 2, '2', '2', 1 + IFNULL( ( SELECT age FROM my WHERE id = 1 ), 0 ) );
报错信息:
[SQL]INSERT INTO my (id, iden, NAME, age)VALUES ( 2, '2', '2', 1 + IFNULL( ( SELECT age FROM my WHERE id = 1 ), 0 ) );[Err] 1093 - You can't specify target table 'my' for update in FROM clause
mysql正确方式
INSERT INTO my (id, iden, NAME, age)VALUES ( 2, '2', '2', 1 + IFNULL( ( SELECT a.age FROM (SELECT age FROM my WHERE id = 1) a ), 0 ) );
OK
[SQL]INSERT INTO my (id,iden, NAME, age)VALUES ( 2, '2', '2', 1 + IFNULL( (SELECT a.age from (SELECT age FROM my WHERE id = 1) a), 0 ) );受影响的行: 1时间: 0.007s
阅读全文
0 0
- mysql异常:You can't specify target table 'my' for update in FROM clause
- mysql 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错误
- MYSQL 临时表 #1093 - You can't specify target table 'dealer_admin' 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错误
- 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中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 ‘A’ for update in FROM clause
- Android 内部存储文件读写权限
- centos运行不了setup命令?怎么安装setup tools
- 大数据及人工智能基础知识复习系列1 二叉树及二叉搜索树
- 应该挖一口属于自己的井
- 数据结构——四
- mysql异常:You can't specify target table 'my' for update in FROM clause
- hexo的Next创建tags
- 2017百度之星资格赛 度度熊的午饭时光(dfs)
- TensorFlow基础知识5-会话(session)
- JS变量重复声明忽略的原理
- 模拟借书系统简易版(慕课网java入门第三季异常)
- Java中,要想跳出多重循环
- 手把手教你整懂http 协议
- CentOS7 .NetCore+Nginx 部署