Last active
December 14, 2015 05:39
-
-
Save otkrsk/5036674 to your computer and use it in GitHub Desktop.
Query to check for Duplicates in a MySQL database.
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
| SELECT * FROM `table_name` | |
| WHERE `record_name` IN ( | |
| SELECT `record_name` | |
| FROM `table_name` | |
| GROUP BY `record_name` | |
| HAVING count(`record_name`) > 1 | |
| ) | |
| ORDER BY `record_name` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment