这句话意思是:不能先select再更新(修改)同一个表。

可以再外嵌套多一层,这个问题只有mysql有,mssql和oracle都没有。

# 出错
delete from Person
where Id not in (
  select min(Id) as Id from Person group by Email);
# 正确
delete from Person
where Id not in (
  select Id from (
    select min(Id) as Id from Person group by Email) p);

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

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

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

    将select出的结果再通过中间表select一遍,这样就规避了错误.注意,这个问题只出现于mysql,mssql和oracle不会出现此问题. mysql中You can't specify tar ...

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

  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错误解决方法,需要的朋友可以参考下 MySQL中You c ...

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

  7. mysql error: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这个表( ...

  8. mysql出现You can’t specify target table for update in FROM clause

    在mysql执行下面语句时报错: You can’t specify target table for update in FROM clause UPDATE edu_grade_hgm_1 ' W ...

  9. mysql中You can't specify target table for update in FROM clause

    使用mysql在删除表中重复记录 delete from user where username in (select user name form(select username from user ...

  10. MySQL中You can't specify target table for update in FROM clause一场

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

随机推荐

  1. 1046 Shortest Distance (20 分)

    1046 Shortest Distance (20 分) The task is really simple: given N exits on a highway which forms a si ...

  2. 如何下载spring的jar包?

    文转载至:https://www.cnblogs.com/yjmyzz/p/3847364.html Spring官网改版后,很多项目的完整zip包下载链接已经隐掉了,虽然Spring旨在引导大家用更 ...

  3. linux进程与线程的区别【转】

    知乎上总结: "linux使用的1:1的线程模型,在内核中是不区分线程和进程的,都是可运行的任务而已.fork调用clone(最少的共享),pthread_create也是调用clone(最 ...

  4. Notepad++配置c++编译环境

    博主学生狗一只,之前一直进行.net开发,用惯了微软的那一套.C#上手容易,开发起来简单,但是正如前辈们所说的,它隐藏了太多底层的东西,惯坏了我,导致快毕业了有些东西一无所知.同时自己想写点简单的算法 ...

  5. 从最大似然函数 到 EM算法详解

    极大似然算法 本来打算把别人讲的好的博文放在上面的,但是感觉那个适合看着玩,我看过之后感觉懂了,然后实际应用就不会了.... MLP其实就是用来求模型参数的,核心就是“模型已知,求取参数”,模型的意思 ...

  6. Eclipse “cannot be resolved to a type”

    遇到这坑爹的问题,网上各种答案. 只有这个能解决我的问题,eclipse机制问题: Eclipse “cannot be resolved to a type”

  7. Java Future 和 FutureTask 源码Demo

    Future 是一个接口,看源码有Future 和 FutreTask 使用Demo package java.util.concurrent; /** * A <tt>Future< ...

  8. as3 单例的不常见写法

    方法一:(显式允许new一次) package { import flash.errors.IllegalOperationError; import flash.events.EventDispat ...

  9. 9 python 多态与多态类

    1.多态定义 多态指的是一类事物的多种形态 比如动物有多种形态:人,狗,猪 import abc class Animal(metaclass=abc.ABCMeta): @abc.abstractm ...

  10. c++ static成员

    static 成员通常不能在类的定义体重初始化 有一种例外,const static成员可以在定义体内初始化,并且可以用于构造函数 将函数声明为const表示该函数不能修改其所属的对象