how to delete duplicate entries in a column in mysql
# Please write a DELETE statement and DO NOT write a SELECT statement.
# Write your MySQL query statement below
DELETE c1 FROM Person c1
INNER JOIN Person c2
WHERE
c1.id > c2.id AND
c1.email = c2.email;
#delete duplicate emails from table Person
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;
DELETE c1 FROM addresslist c1
INNER JOIN addresslist c2
WHERE
c1.id > c2.id AND
c1.`city` = c2.`city` AND
c1.`province` = c2.`province` AND
c1.`pgiRegion` = c2.`pgiRegion`