0-MID4 copy copy
Updated 2024-01-16
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 tab1 as (
select date_trunc('minute',BLOCK_TIMESTAMP) as time
,PRICE_USD
,BUYER_ADDRESS
,SELLER_ADDRESS
from bsc.nft.ez_nft_sales
),
tab2 as (
select date_trunc('week',time) as week
,PRICE_USD
,BUYER_ADDRESS
,SELLER_ADDRESS
,row_number()over(partition by SELLER_ADDRESS order by week) as times_row
from tab1)
select week
,count(SELLER_ADDRESS) as new_sellers
,sum(PRICE_USD) as volume
,sum(new_sellers)over(order by week) as total_new_sellers
,sum(volume)over(order by week) as total_volume
from tab2
where times_row=1
group by 1
QueryRunArchived: QueryRun has been archived