Remove duplicates using only a MySQL query?

后端 未结 7 1193
死守一世寂寞
死守一世寂寞 2020-11-27 07:55

I have a table with the following columns:

URL_ID    
URL_ADDR    
URL_Time

I want to remove duplicates on the URL_ADDR column

7条回答
  •  暖寄归人
    2020-11-27 07:57

    You may want to try the method mentioned at http://labs.creativecommons.org/2010/01/12/removing-duplicate-rows-in-mysql/.

    ALTER IGNORE TABLE your_table ADD UNIQUE INDEX `tmp_index` (URL_ADDR);
    

提交回复
热议问题