mysql删除重复数据
语法:
DELETE FROM 表名
WHERE id NOT IN (
SELECT temp.min_id FROM (
SELECT MIN(id) min_id FROM 表名
GROUP BY 字段名
)AS temp
);
备注:id:也是表字段
实例:
DELETE FROM pro_completed_table
WHERE id NOT IN (
SELECT temp.min_id FROM (
SELECT MIN(id) min_id FROM pro_completed_table
GROUP BY md5
)AS temp
);