背景

在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 错误解决办法的更多相关文章

  1. 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这样的错误,它的意思是说,不能 ...

  2. [转]MySQL 中 You can't specify target table '表名' for update in FROM clause错误解决办法

    原文链接:https://blog.csdn.net/qq_29672495/article/details/72668008

  3. 【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 ...

  4. MySQL中You can't specify target table '表名'('sn_app_label') for update in FROM clause错误解决办法

    在有些时候有级联关系的数据放在了同一张表中,在写sql语句的时候可能会遇到这样的场景:我要插入两条数据,第一条是父节点,第二条是子节点,关联关系是父节点的自增长id:在写这样的sql语句时有可能就会出 ...

  5. 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这个表( ...

  6. 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 ...

  7. 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同一个表的某些值 ...

  8. 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 ...

  9. MySQL出现GROUP BY clause错误解决办法

    #1)当mysql数据库出现如下错误:#which is not functionally dependent on columns in GROUP BY clause; this is incom ...

随机推荐

  1. Azure安装完postgresql遇到:psql: error: could not connect to server: FATAL: no pg_hba.conf entry for host

    进入创建好的Azure Database for PostgreSQL server 点击connection security 在Firewall rules中  Add 0.0.0.0-255.2 ...

  2. ms17-010

    永恒之蓝和ms17-010简介: 永恒之蓝(EternalBLUE)"是Shadow Brokers(影子经纪人)黑客组织公布的一款黑客工具,该工具利用的漏洞也被称为MS17-010漏洞,M ...

  3. linux笔记1(不全,无图版)随笔

    1.ls 查看当前目录下的所有内容 黑色的是文件,蓝色的是文件夹,也就是目录 2.rm -f anaconda-ks. cfg 彻底删除文件(如不确定,则需要先保存备份,也就是快照) 3.ifconf ...

  4. HCNA Routing&Switching之地址转换技术NAT

    前文我们了解了包过滤工具ACL相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15156308.html:今天我们来聊一聊地址转换技术NAT相关话题: ...

  5. 关于phpmyadmin getshell

    思考一个问题:如何在获得一个PHP MySQL 搭建网站的phpmyadmin界面后(无论用什么办法,进到phpmyadmin里),进行一个getshell的操作? ...... 0x01山重水复 当 ...

  6. Python中用max()筛选出列表中出现次数最多的元素

    1 List = [1,2,3,4,2,3,2] # 随意创建一个只有数字的列表 2 maxTimes = max(List,key=List.count) # maxTimes指列表中出现次数最多的 ...

  7. centos8安装mysql8.0

    官网下载rpm地址 https://dev.mysql.com/downloads/repo/yum/ wget下载 wget https://repo.mysql.com//mysql80-comm ...

  8. explorer.exe

    explorer.exe是Windows程序管理器或者文件资源管理器, 它用于管理Windows图形壳,包括桌面和文件管理,删除该程序会导致Windows图形界面无法使用. 终止: taskkill ...

  9. Windows 10 - View SIM Card Number

     If your device isn't running Windows 10, refer to the Windows 8 instructions. From the Windows desk ...

  10. 信号量-Semaphore、SemaphoreSlim

    核心类:Semaphore,通过int数值来控制线程个数. * 通过观察构造函数 public Semaphore(int initialCount, int maximumCount);: * in ...