sepehrmhz8Untitled Query
Updated 2022-08-28
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
›
⌄
with table1 as (
SELECT nft_from_address as sender, tokenid
FROM ethereum.core.ez_nft_transfers
where nft_address = '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'),
table2 as (
select nft_to_address as receiver, tokenid
FROM ethereum.core.ez_nft_transfers
where nft_address = '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'),
table3 as (
select receiver as Holder,
count (distinct t2.tokenid) - count (distinct t1.tokenid) as NFTs
from table1 t1 full outer join table2 t2 on t1.sender = t2.receiver and t1.tokenid = t2.tokenid
where receiver != '0x0000000000000000000000000000000000000000'
group by 1 having NFTs > 0)
select case when NFTS = 1 then 'Holding 1 NFT'
when NFTS > 1 and NFTS <= 2 then 'Holding 2 NFTs'
when NFTS > 2 and NFTS <= 5 then 'Holding 3 - 5 NFTs'
when NFTS > 5 and NFTS <= 10 then 'Holding 6 - 10 NFTs'
else 'Holding More Than 10 NFTs' end as type,
count (distinct holder)
from table3
group by 1
order by 2 desc
Run a query to Download Data