Delete duplicated records from a table without pk or id or unique columns in mysql

前端 未结 4 1545
北荒
北荒 2021-01-20 22:30

I need to delete all the duplicated records from one of my tables the problem is that there isn\'t any id or unique or key column so I can\'t make something like this:

4条回答
  •  逝去的感伤
    2021-01-20 23:02

    there is always a PK per table but you can combine columns as an unique id, so it's possible use a full row as a unique id if you want to... but I don't recommend use a full row, you should search what are the most significant columns that you can use a PK, when you have done that, you can copy the data, if there is no problem the mysql won't copy the duplicate rows.

    sorry for my bad english

提交回复
热议问题