My GIS Blog
Wednesday, October 12, 2011
Deleting duplicate rows in SQL Server
WITH TableDup AS
(
SELECT *,
ROW_NUMBER() OVER( ORDER BY IDCol) AS RN_col
FROM dbo.TableSource
)
DELETE FROM TableDup WHERE RN_col > 1;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment