分组查询并统计
SpecialGroup.group(:special_type).count
select special_type,count(*) from special_groups group by special_type
SpecialGroup.group(:special_type).count(:sno)
select special_type,count(sno) from special_groups group by special_type
SpecialGroup.group(:special_type).count("distinct sno")
select special_type,count(distinct sno) from special_groups group by special_type