-- credit to Ali3N
select 'FLOW' as blockchain,
date_trunc(month,block_timestamp) as date,
count (distinct buyer) as Users_Count
from flow.core.ez_nft_sales
where block_timestamp >= '2022-01-01'
group by 1,2
union ALL
select 'Ethereum' as blockchain,
date_trunc(month,block_timestamp) as date,
count (distinct buyer_address) as Users_Count
from ethereum.core.ez_nft_sales
where block_timestamp >= '2022-01-01'
group by 1,2
union ALL
select 'Solana' as blockchain,
date_trunc(month,block_timestamp) as date,
count (distinct purchaser) as Users_Count
from solana.core.fact_nft_sales
where block_timestamp >= '2022-01-01'
group by 1,2