MLDZMNclay7
    Updated 2023-03-24
    with owner as (
    select * from (
    SELECT
    block_timestamp,
    tx_id,
    mint,
    purchaser,
    SALES_AMOUNT as amount,
    row_number() over(PARTITION BY mint ORDER BY block_timestamp desc) rn
    from solana.core.fact_nft_sales s left outer join solana.core.dim_labels b on s.mint=b.address
    where SUCCEEDED='TRUE'
    and SALES_AMOUNT>0
    and LABEL = 'claynosaurz: clay' -- 'Clay'
    ) where rn = 1 order by block_timestamp desc
    )
    select
    block_timestamp::date as date,
    case when bear_owned = 1 then 'a. 1 NFT'
    when bear_owned = 2 then 'b. 2 NFTs'
    when bear_owned = 3 then 'c. 3 NFTs'
    when bear_owned >= 4 then 'd. over 4 NFTs'
    end as owner_type,
    count(owner_type) as total
    from (
    select count(mint) as bear_owned,
    purchaser,
    block_timestamp
    from owner
    group by purchaser,block_timestamp
    )
    where date>=current_date-60
    group by 1,2
    Run a query to Download Data