select (case when count(distinct id) =1 then '1次'
when count(distinct id) =5 then '5次'
when count(distinct id) =10 then '10次'
else '其他' end) as 次数,rq
from a group by (case when count(distinct id) =1 then '1次'
when count(distinct id) =5 then '5次'
when count(distinct id) =10 then '10次'
else '其他' end) as 次数,rq