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 )
-------------The End-------------
subscribe to my blog by scanning my public wechat account