Skip to content

Instantly share code, notes, and snippets.

@carlwoodhouse
Created January 15, 2015 16:18
Show Gist options
  • Save carlwoodhouse/adbd986b462fdd3fc1ef to your computer and use it in GitHub Desktop.
Save carlwoodhouse/adbd986b462fdd3fc1ef to your computer and use it in GitHub Desktop.
sql duplicates to delete
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