mlhUntitled Query
Updated 2022-11-25Copy 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
›
⌄
with today as (select avg(price) as Current_ETH_Price--credit to alik110
from ethereum.core.fact_hourly_token_prices
where symbol in ('WETH')
and hour::date = '2022-11-23'
),
Nov as (select avg(price) as Nov_ETH_Price
from ethereum.core.fact_hourly_token_prices
where symbol in ('WETH')
and hour::date = '2022-11-01'
),
maintable as (select avg(price) as Avg_ETH_Price,
(avg(case when hour > CURRENT_DATE - 3 then price end) - avg(case when hour::date = '2022-11-01' then price end)) / (avg(case when hour::date = '2022-11-01' THEN price END)) * 100 as Price_Change_Ratio
from ethereum.core.fact_hourly_token_prices
where symbol in ('WETH')
and hour >= '2022-11-01'
)
select current_eth_price,
Nov_ETH_Price,
*
from maintable join today join Nov
Run a query to Download Data