with sale as
(
select *
from flow.core.fact_nft_sales
where nft_collection = 'A.0b2a3299cc857e29.TopShot'
),
moments as (
select play_type, fact_events.*
from flow.core.fact_events
inner join flow.core.dim_topshot_metadata on fact_events.EVENT_DATA:momentID=dim_topshot_metadata.nft_id
where EVENT_CONTRACT = 'A.0b2a3299cc857e29.TopShot'
and EVENT_TYPE = 'MomentMinted'
and TX_SUCCEEDED = true
)
select play_type as "Type of Play", count(sale.*) as "Number of Sales"
from moments , sale
where moments.EVENT_DATA:momentID=sale.nft_id
group by 1
order by 2 desc