Updated 2024-04-09
    with btc_prehalving as (
    select avg(price) as avg,hour::date as days
    , case when hour::date='2020-05-11' then 'halving'
    else 'other' end as category
    from bitcoin.price.ez_hourly_token_prices
    where hour > '2019-12-11' and hour< '2020-8-11'
    group by 2,3
    )
    , btc_currenthalving as
    (
    select avg(price) as avg,hour::date as days
    from bitcoin.price.ez_hourly_token_prices
    where hour > '2023-11-01'
    group by 2
    )

    select * from btc_currenthalving
    QueryRunArchived: QueryRun has been archived