Updated 2024-04-09
    with btc_prehalving as (
    select
    count(*) as txs, sum(output_value) as volume,
    block_timestamp::date as days,
    case when days='2020-05-11' then 'halving'
    else 'other' end as category
    from bitcoin.core.fact_transactions
    where days > '2019-12-11' and days < '2020-8-11'
    group by 3,4)
    , btc_currenthalving as
    (
    select
    count(*) as txs, sum(output_value) as volume,
    block_timestamp::date as days,
    case when days='2020-05-11' then 'halving'
    else 'other' end as category
    from bitcoin.core.fact_transactions
    where days > '2023-11-01'
    group by 3,4
    )

    select * from btc_prehalving

    QueryRunArchived: QueryRun has been archived