Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 如何在删除查询中进行此选择查询?_Mysql_Sql - Fatal编程技术网

Mysql 如何在删除查询中进行此选择查询?

Mysql 如何在删除查询中进行此选择查询?,mysql,sql,Mysql,Sql,查询: 我需要删除此查询的结果。 如何将此查询转换为删除 SELECT accounts.id, accounts.email FROM accounts INNER JOIN (SELECT email FROM accounts GROUP BY email HAVING count(id) > 1) dup ON accounts.email = dup.email DELETE a.* FROM accounts a JOIN (SELECT email FROM a

查询:

我需要删除此查询的结果。 如何将此查询转换为删除

SELECT accounts.id, accounts.email FROM accounts
INNER JOIN (SELECT email FROM accounts
GROUP BY email HAVING count(id) > 1) dup ON accounts.email = dup.email
DELETE a.* FROM accounts a
JOIN (SELECT email
      FROM accounts
      GROUP BY email
      HAVING COUNT(*) > 1) dup
ON a.email = dup.email