Mysql语句提示You can't specify target table 'XXX' for update in FROM clause解决方案
错误提示:You can't specify target table 'XXX' for update in FROM clause
不能从子句中指定更新表的目标表“XXX”
原sql语句:
delete tabel1,tabel2 from info right join tabel1 on tabel2.id=tabel1.id where tabel2 in(select tabel2.id from tabel2 where tabel2.column like '${XXX}%')
这里的问题就是不能同时select同一表的中的数据再进行update该表
所以解决方法就是通过中间表进行更新,即通过查询后的数据生成表t,再引用表t的数据进行更新t2
delete t1,t2 from tabel1 as t1 right join tabel2 as t2 on t1.id=t2.id where t2.id in (select t.tid from( select tabel2.id as tid from tabel2 where tabel2.column like '${XXX}%') t)
Mysql语句提示You can't specify target table 'XXX' for update in FROM clause解决方案相关推荐
- MySQL 语法问题:You can‘t specify target table ‘xxx‘ for update in FROM clause. 原因及解决方法
报错信息如下: [Code: 1093, SQL State: HY000] You can't specify target table 'bd_bankaccbas' for update in ...
- mysql实战(五)—— You can‘t specify target table ‘org_department‘ for update in FROM clause
系列文章目录 You can't specify target table 'org_department' for update in FROM clause 系列文章目录 背景 具体实现过程 1. ...
- 【MySQL】Error Code: 1093. You can‘t specify target table ‘xxx‘ for update in FROM clause
1. 报错信息: Error Code: 1093. You can't specify target table 'self_check' for update in FROM clause 错误的 ...
- 错误:You can't specify target table 'xxx' for update in FROM clause的解决
今天在MySQL数据库删除重复数据的时候遇到了一个问题.如下脚本: DELETE FROM tempA WHERE tid IN ( SELECT MAX(tid) AS tid FROM tempA ...
- [Err] 1093 - You can't specify target table 'xxx' for update in FROM clause解决方法
执行开发同学提供的删除数据的sql时报错[Err] 1093 - You can't specify target table 'run_result' for update in FROM clau ...
- 全网详细解决1093 - You can‘t specify target table ‘xxx‘ for update in FROM clause的错误
文章目录 1. 复现错误 2. 分析错误 3. 解决错误 1. 复现错误 今天在工作时,接到一个新需求,就是将app_page_button表中的label_code字段修改为edit,条件如下: 只 ...
- 记录一个多表查询的问题 #1093 - You can‘t specify target table ‘xxx‘ for update in FROM clause
SQL里面,多表查询比较常见,用法也比较简单 可以是 SELECT ood.oodId, ood.status, ood.userId, orders.createdAt FROM ood, orde ...
- You can‘t specify target table ‘XXX‘ for update in FROM clause
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 报错如题,意思大致是:在一条 sql 语句中不能先查出来部分内容,再同时又对当前表作修改. 解决方法 ...
- MySQL [1093] You can‘t specify target table ‘titles_test‘ for update in FROM clause
执行以下语句: delete from titles_test where id not in(select min(id)from titles_testgroup by emp_no); 会报出错 ...
最新文章
- 【他们都说 select * 不好,但是 。。。】
- ValueError: invalid \x escape
- 公钥密码-非对称加密算法
- BI怎么选?重点看这10个技术指标
- 批量绘制train和test关于特征上的差异
- SAP Spartacus organization unit list抬头显示所有unit的标题实现
- 9.带有返回值的函数
- GPS 校验和 代码_Linux recovery 移除签名校验
- android版 eclipse
- Java 开源报表制作
- 她力量系列四丨读博6年两次换导师,靠一点点“倔”,俞舟成为social chatbot的开拓者之一
- 九爷带你了解 Tomcat 优化
- python大鱼吃小鱼
- 好用的记事提醒软件,手机记事提醒便签下载
- 启动docker时映射到宿主机时出现 /usr/bin/docker-current: Error response from daemon: driver failed……的解决方案
- 阿里云盘小白羊版,带分享功能可转存115文件的第三方客户端
- NLPCC2021.10.14
- 网络交换机 - Swtich 简介
- LTE连接态读取系统消息SIB24疑问
- 康耐视VisionPro基础教程-GigE方式 连接相机
热门文章
- 一起来飞车服务器显示不全,一起来飞车不同服务器可以结婚吗
- oss控制台删除bucket
- 利用multisim仿真基极调频电路(无线咪头电路)
- 数影周报:TikTok因在线跟踪被罚500万欧,Windows 7退出历史舞台
- 360在智能硬件的逆袭
- 基础 | 微信「跳一跳」带火小游戏,开发者如何快速上手?
- 基于 HTML5 WebGL 的楼宇智能化集成系统(一)
- 《Spark商业案例与性能调优实战100课》第18课:商业案例之NBA篮球运动员大数据分析代码实战之核心基础数据项编写
- UnityShader学习——程序纹理
- pg时间戳怎么入oracle库,Oracle与PostgreSQL中Timestamp型公元前、后数值的详解及JDBC存取...