MYSQL错误:You can't specify target table for update in FROM clause
这句话意思是:不能先select再更新(修改)同一个表。
可以再外嵌套多一层,这个问题只有mysql有,mssql和oracle都没有。
# 出错
delete from Person
where Id not in (
select min(Id) as Id from Person group by Email);
# 正确
delete from Person
where Id not in (
select Id from (
select min(Id) as Id from Person group by Email) p);
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错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...
- MySQL 出现You can't specify target table for update in FROM clause错误解决方法
MySQL出现You can’t specify target table for update in FROM clause 这个错误的意思是不能在同一个sql语句中,先select同一个表的某些值 ...
- Mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中)。
将select出的结果再通过中间表select一遍,这样就规避了错误.注意,这个问题只出现于mysql,mssql和oracle不会出现此问题. mysql中You can't specify tar ...
- mysql 出现You can't specify target table for update in FROM clause错误的解决方法
mysql出现You can’t specify target table for update in FROM clause 这个错误的意思是不能在同一个sql语句中,先select同一个表的某些值 ...
- 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 c ...
- MYSQL之You can't specify target table for update in FROM clause解决办法
mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...
- mysql error:You can't specify target table for update in FROM clause
mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...
- mysql出现You can’t specify target table for update in FROM clause
在mysql执行下面语句时报错: You can’t specify target table for update in FROM clause UPDATE edu_grade_hgm_1 ' W ...
- mysql中You can't specify target table for update in FROM clause
使用mysql在删除表中重复记录 delete from user where username in (select user name form(select username from user ...
- 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错误的意思是说,不能先select出同一表中的某些值 ...
随机推荐
- 1010 Radix (25 分)
1010 Radix (25 分) Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 1 ...
- SIP 认证方式
SIP认证是继承了HTTP的认证方式.HTTP的认证方案主要有Basic Authentication Scheme和Digest Access Authentication Scheme两种.而Ba ...
- python的类
一.语法 python类的机制是 C++ 的类机制和 Modula-3 的类机制的混合体: 允许多继承的类继承机制,派生类可以重写它父类的任何方法,一个方法可以调用父类中重名的方法: 1.动态特性: ...
- delphi WebBrowser的使用方法详解(五)-难点释疑
网页代码:<SELECT id=fy onchange=TouchRefresh(1) name=fy> <OPTION selected value=15>每頁顯示15筆&l ...
- USB接口程序编写
copy from http://blog.csdn.net/luckywang1103/article/details/12393889# HID是Human Interface Devices的缩 ...
- spark streaming 概述
批处理 & 流处理 像这个是批处理 像这样就是流处理 为什么需要流处理--更多场景需要 Spark Core & RDD 本质上是离线运算 Spark Streaming是什么(分布式 ...
- CSS宽度高度的百分比取值基于谁
width=num% , height=num% 基于以下几点 1. 若元素不存在定位: 则基于直接父元素的宽高度 2. 若元素存在定位 且 定位为 relative, 则也基于直接父元素的宽高度 3 ...
- Python - Django - ORM 操作表
ORM 的对应关系: 类 ---> 数据库表对象 ---> 数据库行属性 ---> 字段 操作数据库表 ---> ...
- 单元测试工具NUnit的使用
使用 NUnit 工具来进行单元测试 首先在要创建一个单元测试的项目,通常在原有的解决方案中添加新项目, 在弹出的项目类型中选择单元测试,项目的命名一般情况下与解决方案的名称相同后加UnitTes ...
- 在oracle下如何创建database link全面总结
物理上存放于网络的多个ORACLE数据库,逻辑上可以看成一个单一的大型数据库,用户可以通过网络对异地数据库中的数据进行存取,而服务器之间的协同处理对于工作站用户及应用程序而言是完全透明的,开发人员无需 ...