now I have written two sql statements and the results are both posted:
select DATE_FORMAT (date,"%Y-%m") as
month , round (avg (aql), 2) as
avgAQL from cj_tianqi_list group by month order by month
`select
COUNT(if(avgAQL>50&&avgAQL<101,true,null)) as "",
COUNT(if(avgAQL>100&&avgAQL<151,true,null)) as "",
COUNT(if(avgAQL>150&&avgAQL<201,true,null)) as "" from(
select DATE_FORMAT(date,"%Y-%m") as month,round(avg(aql),2) as avgAQL from cj_tianqi_list group by month order by month
) as b`
but the result I want is
state num
good 30
mild pollution 23
moderate pollution 5
ask for God!