Remove duplicates in large MySql table

前端 未结 6 2059
自闭症患者
自闭症患者 2021-01-06 14:44

I have a question about MySql. I have a table with 7.479.194 records. Some records are duplicated. I would like to do this:

insert into new_table 
  select *         


        
6条回答
  •  情歌与酒
    2021-01-06 15:18

    A bit dirty maybe, but it has done the trick for me the few times that I've needed it: Remove duplicate entries in MySQL.

    Basically, you simply create a unique index consisting of all the columns that you wan't to be unique in the table.

    As always before this kind of procedures, a backup before proceeding is recommended.

提交回复
热议问题