查询:
select card_key from tablename where order_no = ‘xxx’ group by card_key HAVING count(card_key) > 1;
select count(1) as repeat_count from tablename where order_no = ‘xxx’ group by card_key HAVING repeat_count > 1;
删除:
DELETE FROM tablename where id in (select id from (select min(id) as id from tablename group by key) as b ) ;
其中key是重复的字段