Mysql - You can't specify target table '表名' for update in FROM clause 错误解决办法
背景
在MySQL中,写SQL语句的时候 ,可能会遇到 You can't specify target table '表名' for update in FROM clause 这样的错误
错误含义
它的意思是说,不能先 select 出同一表中的某些值,再 update 这个表(在同一语句中),即不能依据某字段值做判断再来更新某字段的值。

解决问题
将select出的结果再通过中间表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中,写SQL语句的时候 ,可能会遇到You can't specify target table '表名' for update in FROM clause这样的错误,它的意思是说,不能 ...
- [转]MySQL 中 You can't specify target table '表名' for update in FROM clause错误解决办法
原文链接:https://blog.csdn.net/qq_29672495/article/details/72668008
- 【mysql 】sql删除重复记录 You can't specify target table '表名' for update in FROM clause
用下面的语句就报语法出错: delete from tab_record where recordid not in (select min(c.recordid) as recordid from ...
- MySQL中You can't specify target table '表名'('sn_app_label') for update in FROM clause错误解决办法
在有些时候有级联关系的数据放在了同一张表中,在写sql语句的时候可能会遇到这样的场景:我要插入两条数据,第一条是父节点,第二条是子节点,关联关系是父节点的自增长id:在写这样的sql语句时有可能就会出 ...
- 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--mysql中You can’t specify target table for update in FROM clause错误解决方法
参考:http://www.jb51.net/article/60926.htm mysql中You can't specify target table for update in FROM cla ...
- 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启动报can't create/write to file 'var/run/mysqld/mysqld.pid 错误解决办法
msql启动报错,启动不了. 进入mysql日志默认的路径为 /var/log/mysqld.log 查看日志,发现报错信息如下: can't create/write to file 'var/ru ...
- MySQL出现GROUP BY clause错误解决办法
#1)当mysql数据库出现如下错误:#which is not functionally dependent on columns in GROUP BY clause; this is incom ...
随机推荐
- js 倒计时退出
<p>您已提交成功!<span id='submit_second'></span></p> $("#submit_second") ...
- Vue学习笔记(二)动态绑定、计算属性和事件监听
目录 一.为属性绑定变量 1. v-bind的基本使用 2. v-bind动态绑定class(对象语法) 3. v-bind动态绑定class(数组语法) 4. v-bind动态绑定style(对象语 ...
- 【原创】冰蝎v3.0操作使用手册
写在前面 近期冰蝎更新了内网穿透模块中的一些功能,有不少朋友不知道参数怎么填,希望能出一个使用指导手册,就借这个机会写一个"说明书"(文中有大量演示动图,请耐心等待加载). 基本信 ...
- 【Vulnhub】DC-1靶机
一.信息收集 1.1 环境 kali : 192.168.124.141 DC-1 : 192.168.124.150 1.2 nmap进行扫描 :nmap -sV 192.168.124.150 I ...
- SpringBoot集成Druid
maven <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-b ...
- 安装RHEL7配置本地yum源 -- yum不能安装时,在本地安装,亲测成功
RHEL7 本地yum源配置我们在安装Redhat的时候一般都不会填写注册信息,因为该产品是要购买的,所以我们在使用安装好的Redhat时有的功能是受限的,使用yum源install就是其中之一.那么 ...
- 查看linux系统是物理机还是虚拟机
物理机,返回机器型号 [root@laocalhost ~]# dmidecode -s system-product-name S910-X31E 虚拟机 [root@dev01-188 ~]# d ...
- 【springboot】自定义启动器
本文只对springboot自定义启动器的具体实现进行描述,不涉及springboot自动装配原理的介绍. 对springboot自动配置原理感兴趣的请移步 狂神说SpringBoot02:运行原理初 ...
- SpringMVC之@ControllerAdvice
@ControllerAdvice ,很多初学者可能都没有听说过这个注解,实际上,这是一个非常有用的注解,顾名思义,这是一个增强的 Controller.使用这个 Controller ,可以实现三个 ...
- Spring详解(十)------spring 环境切换
软件开发过程一般涉及"开发 -> 测试 -> 部署上线"多个阶段,每个阶段的环境的配置参数会有不同,如数据源,文件路径等.为避免每次切换环境时都要进行参数配置等繁琐的操 ...