select substring(xh,6,4) as xh,count(*) as countfrom Tabgroup by substring(xh,6,4)
select substring(XH,6,4),count(1) from 表 group by substring(XH,6,4)