mattkstewTop Play Type 4
    Updated 2022-07-21
    with tab1 as (
    select
    play_type,
    count(*)



    from flow.core.fact_nft_sales left outer join flow.core.dim_topshot_metadata
    on flow.core.fact_nft_sales.nft_id = flow.core.dim_topshot_metadata.nft_id
    where flow.core.fact_nft_sales.nft_collection like '%TopShot%'
    and play_type is not null
    group by 1
    order by 2 DESC
    limit 10 )
    select
    date_trunc('day', block_timestamp),
    play_type,
    count(*)



    from flow.core.fact_nft_sales left outer join flow.core.dim_topshot_metadata
    on flow.core.fact_nft_sales.nft_id = flow.core.dim_topshot_metadata.nft_id
    where flow.core.fact_nft_sales.nft_collection like '%TopShot%'
    and play_type is not null
    and play_type in (select play_type from tab1)
    group by 1,2