Pmisha-bmlMdxaverage.users
    Updated 2022-04-27
    with users as(select
    date_trunc('minute',block_timestamp) as min,
    TX_FROM[0] as or_users,
    count (tx_id) as no_transaction
    from terra.transactions
    where block_timestamp::date >= current_date - 60
    group by 1, 2
    having no_transaction < 20)

    select
    case
    when TX_STATUS='SUCCEEDED' then 'succeccful'
    when TX_STATUS='FAILED' then 'failed'
    end as stat,
    count (tx_id) as no_traans
    from terra.transactions
    where block_timestamp::date >= current_date - 60
    and TX_FROM[0] in (select or_users from users )
    group by 1 having stat is not null


    Run a query to Download Data