Skip to content

Instantly share code, notes, and snippets.

@rabbiabram
Created October 17, 2013 03:50
Show Gist options
  • Select an option

  • Save rabbiabram/7018996 to your computer and use it in GitHub Desktop.

Select an option

Save rabbiabram/7018996 to your computer and use it in GitHub Desktop.
Get duplicates records from talbe by field
SELECT * FROM %table_name%
INNER JOIN (SELECT %field_name% FROM %table_name%
GROUP BY %field_name% HAVING count(%id%) > 1) duplication ON %table_name%.%field_name% = duplication.%field_name%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment