Delete duplicate rows in SQL.

Total Post:45

Points:323
 491  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. Post:52

    Points:366
    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

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!