Delete duplicate items – MySQL

Lets say you have a table with columns column1 and column2. You need to make sure all data in them are unique. All you would need to do is run this statement:

ALTER IGNORE TABLE tableName ADD UNIQUE INDEX(column1, column2);

And duplicate records will magically vanish!


1 Comment

Jonatas WalkerSeptember 13th, 2006 at 3:27 am

Wow, wow, wow……

Just PERFECT!!!!!!!!

Many thanks.

Leave a comment

Your comment