Created
January 15, 2015 16:18
-
-
Save carlwoodhouse/adbd986b462fdd3fc1ef to your computer and use it in GitHub Desktop.
sql duplicates to delete
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
DELETE FROM dbo.Orchard_MediaProcessing_FileNameRecord | |
WHERE id in ( | |
SELECT id | |
FROM ( | |
SELECT | |
path, id, | |
ROW_NUMBER() OVER (PARTITION BY path ORDER BY id) AS intRow | |
FROM dbo.Orchard_MediaProcessing_FileNameRecord | |
) AS d | |
WHERE intRow != 1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment