📅  最后修改于: 2022-03-11 15:04:56.039000             🧑  作者: Mango
delete test
from test
inner join (
select max(id) as lastId, email
from test
group by email
having count(*) > 1) duplic on duplic.email = test.email
where test.id < duplic.lastId;