Skip to content

Instantly share code, notes, and snippets.

@bcalloway
Created September 22, 2010 22:08
Show Gist options
  • Save bcalloway/592675 to your computer and use it in GitHub Desktop.
Save bcalloway/592675 to your computer and use it in GitHub Desktop.
SQL query to find duplicate records
SELECT t1.*
FROM table1 AS t1
JOIN (SELECT col1
FROM table1
GROUP BY col1
HAVING count(col1) > 1) AS t2 ON t1.col1 = t2.col1
(where col1 is the column containing the duplication)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment