select count(distinct miner) as miner_count ,
case
when tx_count=1 then 'equal 1'
when tx_count>1 and tx_count<=5 then '>1 and <= 5'
when tx_count>5 and tx_count<=10 then '>5 and <= 10'
when tx_count>10 and tx_count<=50 then '>10 and <= 50'
when tx_count>50 and tx_count<=100 then '>50 and <= 100'
when tx_count>100 and tx_count<=500 then '>100 and <= 500'
when tx_count>500 then '>500'
end as category
from ethereum.core.fact_blocks
where tx_count!=0
group by category