sql去重 删除id比较的的

SELECT * from * where name in (select name from (select name from * group by name having count(name)>1)a) and id not in (select id from(select min(id) as id from * group by name having count(name)>1)b) and community=117 and card_num>80000
ORDER BY `*`.`card_num` ASC
原文地址:https://www.cnblogs.com/chaihtml/p/14861871.html