查询:
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
答案 0 :(得分:1)
DELETE a.* FROM accounts a
JOIN (SELECT email
FROM accounts
GROUP BY email
HAVING COUNT(*) > 1) dup
ON a.email = dup.email