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

Gnanavel Sekar

Gnanavel Sekar has 6+ yrs experience in IT industry as a Sr.Software Engineer and C# Corner MVP. he have strong skill in ASP.Net Core, Azure, C#,ASP.NET,MVC,WEB-API, Kendo UI,C3 Charts, OrchardCMS,Docusign,Jquery,SqlServ... Read more

https://www.c-sharpcorner.com/members/smk-smkg
View All Comments