elenahoointernal_tx_p1
Updated 2022-06-27
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with block as(
select block_number
, block_timestamp
, sum(gas) total_gas
, sum(gas_used) total_gas_used
, count(tx_hash) tx_count
from avalanche.core.fact_traces
where block_timestamp >='2022-06-20'
and tx_status = 'SUCCESS'
group by 1,2
order by block_number asc
)
select block.*
, date_trunc('hour', block_timestamp) as timestamp_h
, TIMESTAMPDIFF(SECONDS, LAG(block_timestamp, 1) OVER (ORDER BY block_timestamp), block_timestamp) block_second
, (block_number - LAG(block_number, 1) over (order by block_number)) block_number_diff
from block
order by block_number asc
Run a query to Download Data