Categorized under: Databases, MySQL, Quick Tips

Cleaning duplicate records in MySQL easily

I was recently looking for a way to clean out a table of all records that had duplicate email addresses. To do this I used a SELECT inside an INSERT statement.

INSERT INTO subscribers(email) SELECT DISTINCT(email) FROM  bad_temp

RSSSubscribe to my feed now.

About Me

GeekyBoy.com