MLDZMNgno3
    Updated 2023-03-15
    with tb1 as (select
    distinct BLOCK_TIMESTAMP,
    BLOCK_NUMBER
    from gnosis.core.fact_transactions
    order by 1
    ),

    tb2 as (select
    BLOCK_NUMBER,
    BLOCK_TIMESTAMP as x1,
    lag(BLOCK_TIMESTAMP,1)over(order by BLOCK_TIMESTAMP) as x2,
    datediff(second,x2,x1) as time_difference
    from tb1 )

    select
    min(time_difference) as minimum_time,
    avg(time_difference) as average_time,
    max(time_difference) as maximum_time
    from tb2
    Run a query to Download Data