How to delete duplicates on a MySQL table?

后端 未结 25 2307
遇见更好的自我
遇见更好的自我 2020-11-22 01:35

I need to DELETE duplicated rows for specified sid on a MySQL table.

How can I do this with an SQL query?

         


        
相关标签:
25条回答
  • 2020-11-22 02:14
    delete from `table` where `table`.`SID` in 
        (
        select t.SID from table t join table t1 on t.title = t1.title  where t.SID > t1.SID
    )
    
    0 讨论(0)
提交回复
热议问题