含义:您不能在子句中为更新指定目标表'xxx'。

错误描述:删除语句中直接含select,如下:

DELETE FROM meriadianannotation WHERE
SeriesID IN (
SELECT
SeriesID as tid
FROM
meriadianannotation
GROUP BY
SeriesID
HAVING
count(SeriesID) > 1
)
AND data NOT IN (
SELECT
min(data) as bid
FROM
meriadianannotation
GROUP BY
SeriesID
HAVING
count(SeriesID) > 1
)

解决方法:加临时表,如下,

DELETE FROM meriadianannotation WHERE
SeriesID IN (
select t.tid from(
SELECT
SeriesID as tid
FROM
meriadianannotation
GROUP BY
SeriesID
HAVING
count(SeriesID) > 1
) t
)
AND data NOT IN (
select b.bid from(
SELECT
min(data) as bid
FROM
meriadianannotation
GROUP BY
SeriesID
HAVING
count(SeriesID) > 1
) b
)

mysql You can't specify target table 'xxx' for update in FROM clause的更多相关文章

  1. mysql You can't specify target table 'xxx' for update in FROM clause的解决

    DELETE from sp_goodscontent where goodsId in (SELECT t.goodsId from ( SELECT goodsId FROM sp_goodsco ...

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

    1.执行sql语句报上面的错误: DELETE FROM db_student WHERE RowGuid IN ( SELECT RowGuid FROM db_student WHERE age ...

  3. 关于mysql 5.7版本“报[Err] 1093 - You can't specify target table 'XXX' for update in FROM clause”错误的bug

    不同于oracle和sqlserver,mysql并不支持在更新某个表的数据时又查询了它,而查询的数据又做了更新的条件,因此我们需要使用如下的语句绕过: , notice_code ) a) ; 本地 ...

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

  5. Mysql -- You can't specify target table 'address' for update in FROM clause

    做地址管理时,需要先根据要设为默认的地址的用户将用户的其他地址都设置为非默认 需要select出用户id然后update 原语句 update address set isdeafult = 0 wh ...

  6. mysql You can't specify target table 'sys_org_relation' for update in FROM clause 删除表条件不能直接包含该表

    mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...

  7. django.db.utils.OperationalError: (1093, "You can't specify target table 'xxx' for update in FROM clause")

    这个错误的意思是,不能在update某张表的where条件中,再次select这张表的某些值作为筛选条件,比如: update message set content = "hello&qu ...

  8. mysql You can't specify target table 'sys_right_menu' for update in FROM clause (不能从Objor子句中指定目标表“SysRyType菜单)

    错误语句: DELETE from sys_right_menu where right_id  in (SELECT m.right_id from sys_right_menu  mLEFT JO ...

  9. Mysql You can't specify target table 'newsalrecord' for update in FROM clause

    这个问题是不能先select出同一表中的某些值,再update这个表(在同一语句中),即不能依据某字段值做判断再来更新某字段的值.解决办法就是建立个临时的表.

随机推荐

  1. solve the promble of VMware Workstation Ubuntu18.04 ethernet interface losting

    $ ifconfig -aens33: flags=4098<BROADCAST,MULTICAST>  mtu 1500    ether 00:**:**:**:**:**  txqu ...

  2. jquery实现漂亮的轮播图

    今天工作中要用到一个轮播功能,在网上找了一些,觉得有些过于繁琐,于是自己动手写了一个,效果如图: 代码如下: <!DOCTYPE html> <html lang="en& ...

  3. Redis集群入门

    官方文章: https://redis.io/topics/cluster-tutorial#redis-cluster-configuration-parameters 本文永久地址: https: ...

  4. [转]Web登录中的信心安全问题

    1. 一个简单的HTML例子看看用户信息安全 标准的HTML语法中,支持在form表单中使用<input></input>标签来创建一个HTTP提交的属性,现代的WEB登录中, ...

  5. 003.2---asyncio模块(上)

    asyncio(上) asyncio 的几个概念 event_loop(事件循环):程序开启一个无线的循环,程序员会把一些函数(协程)注册到事件循环上,当满足事件发生的时候,调用相应的协程函数. co ...

  6. 基于MATLAB的多项式数据拟合方法研究-毕业论文

    摘要:本论文先介绍了多项式数据拟合的相关背景,以及对整个课题做了一个完整的认识.接下来对拟合模型,多项式数学原理进行了详细的讲解,通过对文献的阅读以及自己的知识积累对原理有了一个系统的认识.介绍多项式 ...

  7. jade

    https://github.com/webpack/jade-loader http://jade-lang.com/demo/

  8. 20155307 实验四 Android程序设计

    在安装as的过程中一路顺风,一点问题都没有,但是在编译的时候总是出现错误,无论是我用自己的手机还是虚拟的手机都不能成功. 但是我上网百度,发现错误原因为compileSdkVersion的版本出了问题 ...

  9. 20155319 2016-2017-2 《Java程序设计》第十周学习总结

    20155319 2016-2017-2 <Java程序设计>第十周学习总结 教材学习内容总结 计算机网络编程概述 网络编程就是两个或多个设备之间的数据交换,其实更具体的说,网络编程就是两 ...

  10. spring_cloud多个微服务访问时偶发forward_error问题

    1.问题: 最近在做SpringBoot项目的时候,有多个分开的微服务,偶发forward error 问题 2.猜想: 个人理解为服务跳转错误,可能本身没找到目标服务,或者目标服务损坏 3.解决: ...