MySQL Usuń duplikaty
DELETE c1 FROM tablename c1
INNER JOIN tablename c2
WHERE
c1.id > c2.id AND
c1.unique_field = c2.unique_field;
Matteoweb
DELETE c1 FROM tablename c1
INNER JOIN tablename c2
WHERE
c1.id > c2.id AND
c1.unique_field = c2.unique_field;
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;