Created
July 18, 2013 03:08
-
-
Save marifrahman/6026422 to your computer and use it in GitHub Desktop.
Get duplicate record in a column for each group
This file contains 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
use *DATABASE_NAME* | |
go | |
SELECT *YOUR_FIELD*, COUNT(*) AS dupes | |
FROM *YOUR_TABLE_NAME* | |
GROUP BY *YOUR_FIELD* | |
HAVING (COUNT(*) > 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment