Can't specify target table for update in FROM clause
UPDATE tbl SET col = (
SELECT ... FROM (SELECT.... FROM) AS x);
额外嵌套了一个 SELECT 语句
例如LeetCode 中的 Delete Duplicate Emails
正解:
DELETE
FROM
Person
WHERE
id NOT IN ( SELECT id FROM ( SELECT min( id ) AS id FROM Person GROUP BY email ) AS m );
错解:
DELETE
FROM
Person
WHERE
id NOT IN ( SELECT min( id ) AS id FROM Person GROUP BY email );
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错误的意思是说,不能先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 即:不能先select出同一表中的某些值,再update ...
- 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 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 这个错误的意思是不能在同一个sql语句中,先select同一个表的某些值 ...
- MYSQL 1093 之You can't specify target table for update in FROM clause解决办法
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 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错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中)。
将select出的结果再通过中间表select一遍,这样就规避了错误.注意,这个问题只出现于mysql,mssql和oracle不会出现此问题. mysql中You can't specify tar ...
随机推荐
- SQLite进阶-9.别名
我们可以暂时给表或者列重命名为另一个名字,称为别名,重命名只是临时运行时改变,不会改变数据库中的实际的名字. -- 语法 SELECT column_name AS column_alias_name ...
- MGR复制
CentOS7 配置如下 5.7.22 Group ReplicationMySQL5.7.22安装略 在三台db服务器上面设置/etc/hosts映射,如下:192.168.1.101 mydb ...
- Jmeter的基础使用一安装、启动、关联、断言
一.下载Jmeter,配置环境变量 下载完解压即可, 环境变量配置: -------在环境变量中添加新变量JMETER_HOME:D:\jmeter\apache-jmeter-4.0 ------- ...
- Boot-crm管理系统开发教程(三)
(ps:前两章我们已经把管理员登录和查看用户的功能实现了,那么今天我们将要实现:添加用户,删除用户,和修改用户功能) 由于Cusomer的POJO类型已经写好了,所以这次我们之前从CustomerCo ...
- List与Set区别
List: 元素有序放入,元素可重复 Set: 元素无序保存,元素不可重复(通过==判断,非基本类型判断的是引用地址),因为set是无序的,故只能通过迭代器循环.ps:说是无序,但是其实set中的元素 ...
- 树莓派3B+和3B 安装64位debian GUN/Linux系统
请直接参考如下博客: https://blog.csdn.net/u013451404/article/details/80710136 如果是3B的树莓派用户,只需要把第一个分区boot里的.dtb ...
- luogu题解 P2860[USACO冗余路径Redundant Paths] 缩点+桥
题目链接 https://www.luogu.org/problemnew/show/P2860 https://www.lydsy.com/JudgeOnline/problem.php?id=17 ...
- [转载]python with语句的用法
https://www.cnblogs.com/DswCnblog/p/6126588.html 看这篇文章的时候看到了python的类名()用法,很好奇,上网查了下,原来这就相当于对类进行实例化了. ...
- mysql计算QPS
首先连接上mysql: $ mysql -h .x -P3306 -uusername -p123456 进入Mysql之后,查询general_log: mysql> SHOW VARIABL ...
- python入坑级
pycharm设置 pycharm设置自动换行的方法 只对当前文件有效的操作:菜单栏->View -> Active Editor -> Use Soft Wraps: 如果想对所有 ...