select id, count(*)from tabgroup by idcount(*)就是你id组对应的条数
假如表 test 字段 a, b;按照a分组select a,count(*) 条数from testgroup by a
group by xxhaving count(*)>=n