Home >Backend Development >PHP Tutorial >A simple method to delete duplicate rows in a table_PHP tutorial

A simple method to delete duplicate rows in a table_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:02:49826browse

First create a table that is the same as the original table,
and then create an ignore_dup_key index on the table, as follows:
CREATE UNIQUE INDEX removedups
ON  #table_copy (name)
WITH IGNORE_DUP_KEY
Then import Original table data, keep it simple


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631024.htmlTechArticleFirst create a table that is the same as the original table, and then create the ignore_dup_key index on the table, as follows: CREATE UNIQUE INDEX removedups ON #table_copy (name) WITH IGNORE_DUP_KEY Then import the original...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn