Please tell me how to write a sql statement.

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
clipboard.png

`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`

clipboard.png
but the result I want is
state num
good 30
mild pollution 23
moderate pollution 5

ask for God!

Mar.11,2021

select state, count(*)
from (
    select 
        case 
          when avgAQL>50  &&  avgAQL<101 then ''
          when avgAQL>100 &&  avgAQL<151 then ''
          when avgAQL>150 &&  avgAQL<201 then ''
          else ''
        end as state
    from t
)
group by state
order by state

Sorry, every time I know what the specific problem is

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46329-44b87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46329-44b87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?