Skip to content

Instantly share code, notes, and snippets.

@kencenerelli
Created April 18, 2013 15:31
Show Gist options
  • Select an option

  • Save kencenerelli/5413677 to your computer and use it in GitHub Desktop.

Select an option

Save kencenerelli/5413677 to your computer and use it in GitHub Desktop.
Query duplicate records in a SQL Server table
SELECT Column1, Column2, COUNT(*) AS Amount
FROM TableName
GROUP BY Column1, Column2
HAVING (COUNT(*) > 1)
ORDER BY Column1, Column2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment