select count (distinct tx_hash) as TXN,
(count (distinct case when STATUS = 'SUCCESS' then tx_hash end) / count(distinct tx_hash)) * 100 as Success_Rate,
case
when block_timestamp >= '2022-08-01' and block_timestamp < '2022-09-15' then 'Before Merge'
when block_timestamp >= '2022-09-15' then 'After Merge' else null end as Merge
from ethereum.core.fact_transactions
where block_timestamp >= '2022-09-05' and block_timestamp <= '2022-09-24'
group by Merge