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 ...
随机推荐
- spring-boot 环境搭建(一)
环境 jdk 8 tomcat 8.5 sts 4.4.2 maven 3.6.1 新建 maven 项目 首先创建一个普通的 maven 项目. pom.xml <project xmlns= ...
- 在Hadoop中ResourceManager是干什么的?
[学习笔记] 1)ResourceManager:马克-to-win @ 马克java社区:防盗版实名手机尾号:73203.当应用程序对集群资源需求时,ResourceManager是Yarn集群主控 ...
- linux + qt 环境搭建
下载地址 install qt huqian@huqian-Lenovo-IdeaPad-Y400:~/XRF$ ls qt-opensource-linux-x64-.run SourceFile ...
- C语言中signed和unsigned理解
一直在学java,今天开始研究ACM的算法题,需要用到C语言,发现好多知识点都不清楚了,看来以后要多多总结~ signed意思为有符号的,也就是第一个位代表正负,剩余的代表大小,例如:signed i ...
- JS基础_基本数据类型和引用数据类型
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- [Android] Installation failed due to: ''pm install-create -r -t -S 4590498' returns error 'UNSUPPORTED''
小米特有问题 关闭开发者选项的启用MIUI优化 不得不说, 这是真的坑...
- python之jupyter notebook
jupyter是一种交互式计算和开发环境的笔记,ipython命令行比原生的python命令行更加友好和高效,还可以运行web版的界面,支持多语言,输出图形.音频.视频等功能. 安装 pip inst ...
- mysql命令行的一些小技巧【实用:多屏显示,格式化输出等】
1.以html格式输出结果使用mysql客户端的参数–html或者-T,则所有SQL的查询结果会自动生成为html的table代码$ mysql -u root --htmlWelcome to th ...
- Delphi DLL文件的动态调用
樊伟胜
- -sh: ./a.out: not found
感觉程序没有问题,编译生成a.out后,拷贝到开发板执行,提示 -sh: ./a.out: not found. 上网查找问题,大概原因有2个 一就是有可能/lib下面没有C库 就是没有glibc或者 ...