Query editor
with to_cnt as(selectto,count(*) as cntfrom erc721_polygon.evt_Transferwhere 1=1and contract_address = '0x9d3aca725a289c6e798355592cd3dd5e43fa14a5'group by 1),from_cnt as(selectfrom,count(*) as cntfrom erc721_polygon.evt_Transferwhere 1=1and contract_address = '0x9d3aca725a289c6e798355592cd3dd5e43fa14a5'group by 1),holder as (selectto as addr,t.cnt-coalesce(f.cnt, 0) as cntfrom to_cnt tleft join from_cnt f on t.to = f.from)select(casewhen cnt = 1 then '(a) 1'when cnt = 2 then '(b) 2'when cnt = 3 then '(c) 3'when 6 >= cnt and cnt >= 4 then '(d) 4-6'when 9 >= cnt and cnt >= 7 then '(e) 7-9'when cnt >= 10 then '(f) 10+'end) as cnt,count(addr) as addrfrom holderwhere cnt > 0group by 1