Remove duplicates in large MySql table

前端 未结 6 2060
自闭症患者
自闭症患者 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:29

    MySQL has a INSERT IGNORE. From the docs:

    [...] however, when INSERT IGNORE is used, the insert operation fails silently for the row containing the unmatched value, but any rows that are matched are inserted.

    So you could use your query from above b just adding a IGNORE

提交回复
热议问题