Created
August 19, 2013 14:33
-
-
Save uovidiu/6269799 to your computer and use it in GitHub Desktop.
mysql search duplicates
mysql remove duplicates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // search duplicates | |
| SELECT field, field_1, count(*) | |
| FROM table | |
| GROUP BY field, field_1 HAVING count(*) > 1; | |
| //remove duplicates | |
| ALTER IGNORE TABLE `sometable` ADD UNIQUE INDEX(field,field_1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment