select
b.PRIMARYPOLLUTANT,count(b.PRIMARYPOLLUTANT) as primarypollutantCountfrom
(select PRIMARYPOLLUTANT=convert(xml,' <root> <v>'+replace(PRIMARYPOLLUTANT,',',' </v> <v>')+' </v> </root>') from AIR_BASE_DAY_AQI
where AQI>='100' and TIMEPOINT>='2016-12-11' and TIMEPOINT<'2016-12-13')a
outer apply
(select PRIMARYPOLLUTANT=C.v.value('.','nvarchar(100)') from a.PRIMARYPOLLUTANT.nodes('/root/v')C(v))b
group by b.PRIMARYPOLLUTANT