You can't specify target table 'Person' for update in FROM clause
问题原因
待更新的目标表不能直接出现在from子句中;
错误写法
DELETE
FROM
Person
WHERE
id NOT IN ( SELECT min( id ) FROM person t1 GROUP BY email )
正确写法(多封装一层)
DELETE
FROM
Person
WHERE
id NOT IN ( SELECT * FROM ( SELECT min( id ) FROM person t1 GROUP BY email ) t1 )
参考文章