一句sql 删除 数据库重复记录


delete a from 表名 a, (select *,min(主键) as c from 表名 group by 重复字段 having count(1) > 1) as b

where a.重复字段= b.重复字段 and a.主键 > b.c
原文地址:https://www.cnblogs.com/marryZhan/p/2497549.html