MLDZMNsol.open9
Updated 2022-11-25
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
›
⌄
with owner as (
select * from (
SELECT
block_timestamp,
TX_ID,
mint,
purchaser,
SALES_AMOUNT as amount,
row_number() over(PARTITION BY mint ORDER BY block_timestamp desc) rn
from solana.core.fact_nft_sales
where SUCCEEDED='TRUE'
and BLOCK_TIMESTAMP>=CURRENT_DATE- {{Time_period}}
and MARKETPLACE = '{{Marketplace}}'
and SALES_AMOUNT>0
) where rn = 1 order by block_timestamp desc
)
select
case when bear_owned = 1 then 'a. 1 NFT'
when bear_owned = 2 then 'b. 2 NFTs'
when bear_owned = 3 then 'c. 3 NFTs'
when bear_owned >= 4 then 'd. over 4 NFTs'
end as owner_type,
count(owner_type) as total
from (
select count(mint) as bear_owned,
purchaser
from owner
group by purchaser
) group by owner_type
Run a query to Download Data