一、背景
二、实现
查看表的重复数据条数
SELECT count(1) a,serial_no FROM `mud_weighbridge_record` GROUP BY serial_no HAVING a >1 ;
删除表的重复数据
DELETE t1 from
mud_weighbridge_record t1
inner join (SELECT min(record_id) record_id,serial_no,count(1) FROM mud_weighbridge_record GROUP BY serial_no HAVING count(1) >1) t2
on t1.serial_no = t2.serial_no
where t1.record_id > t2.record_id;