Delete duplicate rows from a table in sql server

Much time we need to remove data according to some columns. In this article we will delete the duplicate data according email . Lets’ see:-

Database table:-



Sql Query:-
with TempTable as

(

select *, row_number() over (partition by Email order by Email) as Rank

from reg

)

Delete from TempTable where Rank >1

Out-Put:-







Delete duplicate rows from a table in sql server Delete duplicate rows from a table in sql server Reviewed by NEERAJ SRIVASTAVA on 11:48:00 AM Rating: 5

No comments:

Powered by Blogger.