DevJacobicurrent-distribution-usdt
    Updated 2022-07-27
    with usdt_cleared as (
    select * from flipside_prod_db.algorand.account_asset
    where asset_id = 312769
    and asset_closed = 'FALSE'
    and frozen = 'FALSE'
    )

    select amount_group, count(*) as anzahl from (
    select case
    when amount / 1000000 = 0 then '0'
    when amount / 1000000 < 1 then '< 1'
    when amount / 1000000 < 10 then '1 < x < 10'
    when amount / 1000000 < 100 then '10 < x < 100'
    when amount / 1000000 < 1000 then '100 < x < 1T'
    when amount / 1000000 < 10000 then '1T < x < 10T'
    when amount / 1000000 < 100000 then '10T < x < 100T'
    when amount / 1000000 < 1000000 then '100T < x < 1M'
    when amount / 1000000 < 10000000 then '1M < x < 10M'
    when amount / 1000000 < 100000000 then '10M < x < 100M'
    when amount / 1000000 < 1000000000 then '100M < x < 1Mrd'
    else '1Mrd+'
    end as amount_group
    from usdt_cleared
    ) group by amount_group
    order by amount_group
    Run a query to Download Data