MySQL 子查询的限制

文档: https://dev.mysql.com/doc/refman/8.0/en/subquery-restrictions.html

子查询的限制

  • 通常,您无法修改表并从子查询中的同一表中进行选择。例如,此限制适用于以下形式的陈述:

    DELETE FROM t WHERE ... (SELECT ... FROM t ...);
    UPDATE t ... WHERE col = (SELECT ... FROM t ...);
    {INSERT|REPLACE} INTO t (SELECT ... FROM t ...);
tags: Mysql