MahrooUntitled Query
    Updated 2022-10-02
    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