Delete duplicate rows in SQL.

Total Post:45

Points:323

 778  View(s)
Ratings:
Rate this:

I am facing a problem in Sql. By mistake I have inserted some duplicate record. I want to delete all duplicate record ,

Delete duplicate rows in SQL.

Can anyone tell me the query ,,,


  1. Re: Delete duplicate rows in SQL.

    Use this query

    with SalaryCTE AS
    
    (
    select *, ROW_NUMBER() over (partition by id order by id) as rownumber from salary
    )
    DELETE from SalaryCTE where rownumber >1

    It helps you.


Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.