MLDZMNmadu6
    Updated 2023-06-02
    with t1 as (select
    BLOCK_TIMESTAMP,
    tx_id,
    purchaser as wl
    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 = 'mad lads'
    ),

    t2 as (select
    BLOCK_TIMESTAMP,
    purchaser as wl1,
    tx_id,
    ROW_NUMBER() OVER (partition by purchaser order by BLOCK_TIMESTAMP) as t_n
    from solana.core.fact_nft_sales
    where SUCCEEDED='TRUE'
    and purchaser in (select wl from t1)
    )

    select
    case
    when t1.tx_id=t2.tx_id then 'Create to buy Mad Lads'
    else 'Other purchasers' end as gp,
    count(distinct wl1) as no_users

    from t2 left join t1 on wl1=wl
    where t_n=1
    group by 1
    Run a query to Download Data