mattkstewnothing atm1
Updated 2023-01-17Copy 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
›
⌄
with tab1 as (
select
message_value:contract,
min(BLOCK_TIMESTAMP) as date1
from terra.core.ez_messages
where message_type like '%Contract%'
group by 1
)
select
date_trunc('day', date1) as date1,
case when date1 > '2022-12-01' then '2023'
else '2022'
END as Year_to_date,
count(*) as value
from tab1
--where date1 > current_date - 180
group by 1,2
order by 1
-- find average amount normally compared to rn.
Run a query to Download Data