MahrooUntitled Query
Updated 2022-10-02Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with eth_price as (select date_trunc('day',HOUR) as day, round(avg(price)) as eth_price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
and day >='2022-06-01'
group by day
order by day),
BTC_price as (select date_trunc('day',HOUR) as day, round(avg(price)) as BTC_price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WBTC'
and day >='2022-06-01'
group by day
order by day)
SELECT a.day, a.eth_price, b.BTC_price,
case when a.day <'2022-09-14' then 'before_merge'
when a.day >= '2022-09-14' then 'after_merge'
end as merge_time
from eth_price a
join BTC_price b
on a.day=b.day
Run a query to Download Data