Here's a code snippet which removes the duplicate records,using CTE
WITH CTE ([col1], cnt)
AS
(
SELECT [col1],
ROW_NUMBER() OVER(PARTITION BY [col1] ORDER BY [col1]) AS cnt
FROM table1
)
DELETE
FROM CTE
WHERE cnt > 1
Here's a code snippet which removes the duplicate records,using CTE
0 comments:
Post a Comment