By using these commnad of line we can 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