You can’t specify target table for update in FROM claus

简介: 不能查询一个表然后再修改这个表,在内层查询中嵌套一个查询,认为是查询中间表update product set company = 'TG' WHERE id in ( SELECT cc.

不能查询一个表然后再修改这个表,在内层查询中嵌套一个查询,认为是查询中间表

update product  set company = 'TG' WHERE id in ( SELECT cc.id from (SELECT tt.id from product tt WHERE tt.product_no like 'TG%') cc);
目录
相关文章
|
6月前
|
SQL NoSQL MongoDB
db.oplog.rs.find({"ns": "your_database_name.your_collection_name", "o": {$exists: true}}).sort({$natural: -1}).limit(1)
【5月更文挑战第22天】db.oplog.rs.find({"ns": "your_database_name.your_collection_name", "o": {$exists: true}}).sort({$natural: -1}).limit(1) 的作用
52 6
|
12月前
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘thinkphp.test‘ don‘t exsit
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘thinkphp.test‘ don‘t exsit
298 0
|
关系型数据库 MySQL
【问题处理】—— Mysql : You can‘t specify target table for update in FROM clause
【问题处理】—— Mysql : You can‘t specify target table for update in FROM clause
745 1
|
存储 关系型数据库 MySQL
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
3582 0
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
|
SQL 关系型数据库 MySQL
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
212 0
mysql Error Code: 1175. You are using safe update mode and you tried to update a table without ....
|
关系型数据库 MySQL 数据库
MySQL问题解决:Cannot delete or update a parent row: a foreign key constraint fails
MySQL问题解决:Cannot delete or update a parent row: a foreign key constraint fails
1283 0
test of duplicate control id
Created by Jerry Wang, last modified on Aug 21, 2015
test of duplicate control id
|
SQL Oracle 关系型数据库
1120 11g select for update skip locked
[20171120]11g select for update skip locked.txt --//11G在select for update遇到阻塞时可以通过skipped locked跳过阻塞的记录,测试看看: 1.
1276 0