mo1152023-03-08 10:32 PM
Updated 2023-03-08
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
with f as (select date_trunc ('day', BLOCK_TIMESTAMP) as Day,
case when NODE_DATA:follow is not null then 'Follow'
else null
end as Follows
from near.social.fact_decoded_actions
where Day >= CURRENT_DATE - 5
),
u as (select date_trunc ('day', BLOCK_TIMESTAMP) as Day,
case when NODE_DATA:Unfollow is not null then 'Unfollow'
else null
end as Unfollows
from near.social.fact_decoded_actions
where Day >= CURRENT_DATE - 5 )
select u.DAY,
count (Follows) ,
count (Unfollows)
from f f join u u on f.day = u.day
group by 1