mysql中不能查自己同时更新自己,需要把子查询的查询结果用个临时表装

报错sql语句:

delete from tb_task_detail where main_id in (select main_id from tb_task_detail where id = 5 )

修改后sql语句

delete from tb_task_detail where main_id in (select * from (select main_id from tb_task_detail where id = 5 )a)

You can't specify target table ''相关推荐

  1. [Django](1093, quot;You can#39;t specify target table #39;fee_details_invoices#39; for update in...

    dele_id = Fee_details_invoices.objects.filter(fee_detail_id__in=fee_id_list, return_type='2').values ...

  2. You can't specify target table for update in FROM clause

    今天使用mysql,写出一个sql语句: update service_re set is_deleted=0 where id=(select id from service_re where p_ ...

  3. 错误: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 ...

  4. Mysql 错误 Code: 1093. You can't specify target table for update in FROM clause

    You can't specify target table 'recharge_log' for update in FROM clause 这个问题出现的情况是: 更新一个表的数据时,where条 ...

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

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

  7. You can't specify target table '表名' for update……

    2019独角兽企业重金招聘Python工程师标准>>> 建表sql DROP TABLE IF EXISTS `car`; CREATE TABLE `car` (`id` int( ...

  8. You can't specify target table 'TS_AUTH_ADMIN' for update in FROM clause记录

    1. 报错:You can't specify target table 'TS_AUTH_ADMIN' for update in FROM clause, 百度查到说是,不能在同一语句中先sele ...

  9. mysql: you can't specify target table 问题解决

    首先创建一个表: CREATE TABLE `t1` ( `id` INT(11) NULL DEFAULT NULL, `name` VARCHAR(20) NULL DEFAULT NULL ) ...

  10. [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 ...

最新文章

  1. [译稿]同步复制提议 2010-09
  2. php hasattribute,PHP DOMElement hasAttribute()用法及代码示例
  3. APS:大型多模态室内摄像机定位系统
  4. 2010提高组-乌龟棋 [记忆优化搜索]
  5. Swift、Flutter 共同瞄准 Windows!
  6. php什么设置前端代码,代码编辑器与PHPSTUDY的安装与配置过程(前端第一课)
  7. you *might* want to use the less safe log_bin_trust_function_creators variable
  8. java中的pane,Java中scroll pane的使用(一)– 动态改变其client的大小 | 学步园
  9. Java多线程系列--“JUC锁”10之 CyclicBarrier原理和示例
  10. del/xcopy时如何在输出窗口中,不显示文件名
  11. shopee上架接口java_关于shopee平台接口(php)对接示例
  12. 4_04_GLib库入门与实践_指针数组
  13. react 跳转外部链接
  14. ssm毕设项目iGame游戏交易平台nzln3(java+VUE+Mybatis+Maven+Mysql+sprnig)
  15. Dextran-PEG2000-Conjugate,葡聚糖聚乙二醇Conjugate,葡聚糖聚乙二醇,属于葡聚糖缀合物
  16. java 商城 商品查询_Javaweb网上商城项目实战(17)实现商品详情查询
  17. python在一个函数中调用另一函数中的变量
  18. C语言项目二:电阻并联
  19. linux网卡恢复默认配置,Linux网卡的配置
  20. 天正当前比例怎么设置_AutoCAD绘图如何调整比例

热门文章

  1. Trends in Neurosciences:通过脑振荡的夹带调节人类记忆
  2. php 强制用户 退出,Spring Security 强制退出指定用户的方法
  3. Windows下使用NIF扩展Erlang方法
  4. 窥镜下的OLTP以及我们的发现(一)
  5. 华为OD 机试题:众数和中位数
  6. 《游戏开发核心技术-剧本与角色创造》阅读不枯燥
  7. 在Mac上如何轻松下载来自浏览器的软件或内容
  8. 计算机科学与技术专业好就业吗,计算机科学与技术专业好就业吗
  9. Android 电话拨号器程序
  10. iOS笔记UI--委托代理传值