Created
February 16, 2017 20:26
-
-
Save osmyn/5675d5f13020b316cb0087b4b31990f2 to your computer and use it in GitHub Desktop.
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
WITH cte AS | |
(SELECT *, ROW_NUMBER() OVER (PARTITION BY col1, col2, col3, col4 ORDER BY (SELECT 0)) AS DuplicateRowNumber | |
FROM table | |
) | |
--SELECT * FROM cte WHERE DuplicateRowNumber > 1 | |
DELETE FROM cte WHERE DuplicateRowNumber > 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment