Deleting duplicate record from table - SQL query

前端 未结 7 1062
有刺的猬
有刺的猬 2021-02-03 15:09

I need to delete duplicate rows only from the table, like I have 3 duplicate rows in the table, my query will delete 2 rows from 3 duplicated rows.

How can I get this? P

7条回答
  •  梦毁少年i
    2021-02-03 15:23

    If you have the id's of the rows you want to delete then...

    DELETE FROM table WHERE id IN (1, 4, 7, [id numbers to delete...])
    

提交回复
热议问题