Created
April 9, 2015 01:29
-
-
Save Saanch/c4f93d054c34978d538a to your computer and use it in GitHub Desktop.
MSSQL Query to delete duplicate rows from a TABLE leaving the first occurance
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 [tableName] WHERE [UniqueId] NOT IN | |
(SELECT Min([UniqueId]) FROM [tableName] GROUP BY [fieldName]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment