mattkstewIn The News, Wallets 2
Updated 2023-01-06Copy Reference Fork
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
›
⌄
with tab1 as (
select
date_trunc('day', block_timestamp) as date1,
count(*) as created
from near.core.fact_actions_events
where action_name in ('CreateAccount')
and date1 > current_date - 60
group by 1 )
, tab2 as (
select
date_trunc('day', block_timestamp) as date2,
count(*) as deleted
from near.core.fact_actions_events
where action_name in ('DeleteAccount')
and date2 > current_date - 60
group by 1 )
select
date1,
case when date1 >= '2023-01-01' then '2023' else '2022' end as Year_to_date,
created - deleted
from tab1 left outer join tab2 on date1 = date2
Run a query to Download Data