MySQL数据库去重
MySQL数据库去重
DELETE FROM table
WHERE去重字段名
IN (
SELECT x FROM
(
SELECT 去重字段名
AS x
FROM table
GROUP BY 去重字段名
HAVING COUNT(去重字段名
) > 1
) tmp0
)
AND递增主键名
NOT IN (
SELECT y FROM
(
SELECT min(递增主键名
) AS y
FROM table
GROUP BY 去重字段名
HAVING COUNT(去重字段名
) > 1
) tmp1
)
来源:51CTO
作者:DokcelyNg
链接:https://blog.csdn.net/Lmingtian_huigenghao/article/details/100584227