Home > Database > Mysql Tutorial > body text

一种简单的表中删除重复行的方法_MySQL

WBOY
Release: 2016-06-01 14:05:19
Original
939 people have browsed it

先创建一个与原表一样的表,

然后在表上创建 ignore_dup_key 索引,如下:

CREATE UNIQUE INDEX removedups
ON  #table_copy (name)
WITH IGNORE_DUP_KEY


然后在导入原表数据,简单吧

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template