Delete Duplicate Records From a Table

WITH [GetDuplicate] AS

(

   SELECT RowNum = ROW_NUMBER() OVER (PARTITION BY Name ORDER BY Id DESC),

   Name

   FROM Employee

)

DELETE FROM [GetDuplicate] WHERE RowNum > 1

Ebook Download
View all
Learn
View all