Removing duplicates with unique index
If you have duplicates in your table and you use ALTER TABLE mytable ADD UNIQUE INDEX myindex (A, B, C, D); the query will fail with Error 1062 (duplicate key). But if you use IGNORE — (only works before MySQL 5.7.4) ALTER IGNORE TABLE mytable ADD UNIQUE INDEX myindex (A, B, C, D); the duplicates … Read more