rajsNear
    Updated 2022-09-03
    with new_users as
    (
    SELECT
    tx_signer as user,
    min(block_timestamp) as date_joined
    from near.core.fact_transactions
    -- where tx_hash = '4EnjfJZjyrU5aiC4osF5xR8aZDAgyFt1n3Azjd4x39rL'
    group by 1
    )
    ,

    first_txs as
    (
    SELECT
    *
    from near.core.fact_transactions t
    inner join new_users n
    on t.block_timestamp = date_joined
    and tx_signer = user
    )
    ,
    req_tab as
    (
    SELECT
    action_name,
    count(*)
    from near.core.fact_actions_events
    -- where tx_hash = '4EnjfJZjyrU5aiC4osF5xR8aZDAgyFt1n3Azjd4x39rL'
    where tx_hash IN
    (
    SELECT
    tx_hash
    from first_txs
    )
    group by 1
    Run a query to Download Data