Updated 2022-09-02
    with a as (
    select BLOCK_NUMBER,
    block_timestamp,
    datediff(second, lag(block_timestamp, 1) over (order by block_timestamp asc), block_timestamp) as block_time ,'polygon ' as title
    from polygon.core.fact_blocks
    -- order by BLOCK_NUMBER
    UNION

    select BLOCK_NUMBER,
    block_timestamp,
    datediff(second, lag(block_timestamp, 1) over (order by block_timestamp asc), block_timestamp) as block_time ,' arbitrum' as title
    from arbitrum.core.fact_blocks
    -- order by BLOCK_NUMBER ,title

    UNION

    select BLOCK_NUMBER,
    block_timestamp,
    datediff(second, lag(block_timestamp, 1) over (order by block_timestamp asc), block_timestamp) as block_time ,'optimism ' as title
    from optimism.core.fact_blocks
    -- order by BLOCK_NUMBER ,title
    UNION

    select BLOCK_NUMBER,
    block_timestamp,
    datediff(second, lag(block_timestamp, 1) over (order by block_timestamp asc), block_timestamp) as block_time ,' ethereum' as title
    from ethereum.core.fact_blocks
    -- order by BLOCK_NUMBER ,title
    )

    select max(block_time) as "Max BlockTime", min(block_time) as "Min Blocktime" ,title
    from a group by title
    Run a query to Download Data