Created
September 15, 2015 07:06
-
-
Save halityurttas/cde2ff8d5d9a1984166a to your computer and use it in GitHub Desktop.
T-SQL Delete Duplicate Rows
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 [col1], [col2], [col3], [col4], [col5], [col6], [col7], | |
RN = ROW_NUMBER()OVER(PARTITION BY col1 ORDER BY col1) | |
FROM dbo.Table1 | |
) | |
DELETE FROM CTE WHERE RN > 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment