with old_collection as (
select nft_collection, min(block_timestamp::date) as first_sale
from flow.core.fact_nft_sales
group by 1 having first_Sale < '2022-06-01'
)
select count(distinct tx_id), 'existing collection' as type
from flow.core.fact_nft_sales
where nft_collection in (select nft_collection from old_collection)
union all
select count(distinct tx_id), 'new collection' as type
from flow.core.fact_nft_sales
where nft_collection not in (select nft_collection from old_collection)