Updated 2022-10-07
    with a as(
    select ADDRESS_NAME as address,
    sum(amount) as toal_amount
    from solana.core.fact_transfers t,solana.core.dim_labels l
    where t.TX_TO = l.address
    and mint= 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    group by 1
    order by 2 DESC
    limit 8
    )

    select
    date_trunc('day',BLOCK_TIMESTAMP) as date
    ,case when ADDRESS_NAME in (select address from a ) then ADDRESS_NAME else 'others' end as address
    ,sum(amount) as Amount
    from solana.core.fact_transfers t,solana.core.dim_labels l
    where t.TX_TO = l.address
    and mint= 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    group by 1,2
    order by 1 asc
    Run a query to Download Data