adambaladoodles127
    Updated 2023-11-07
    with
    a as (
    select
    nft_to_address as wallets,
    '1' as flag
    FROM ethereum.core.ez_nft_transfers
    where (nft_address =lower('0x8a90cab2b38dba80c64b7734e58ee1db38b8992e')
    )

    union all

    SELECT
    nft_from_address as wallets,
    '-1' as flag
    FROM ethereum.core.ez_nft_transfers
    where (nft_address =lower('0x8a90cab2b38dba80c64b7734e58ee1db38b8992e')
    )
    ),

    b as (
    select
    wallets ,
    sum(flag) as nfts
    from a
    group by 1
    having 2 > 0
    order by 2 desc)


    select
    count(distinct wallets) as "value",
    case
    when nfts = 1 then '1 NFT'
    when nfts = 2 then '2 NFT'
    when nfts = 3 then '3 NFT'
    Run a query to Download Data