flow-models/tests/tests__block_timestamp_order.sql
Jack Forgash c4f5ac129d
remove threshold (#120)
* remove threshold

* cast date
2023-05-05 14:04:12 -06:00

23 lines
417 B
SQL

{{ config(
severity = "warn",
error_if = ">100",
enabled = False
) }}
SELECT
DATEDIFF(
SECOND,
A.block_timestamp,
b.block_timestamp
) AS avg_time_diff,
b.block_height AS bheight,
b.block_timestamp AS btime,
A.*
FROM
{{ ref('silver__blocks') }} A,
{{ ref('silver__blocks') }}
b
WHERE
A.block_height = b.block_height -1
AND avg_time_diff < 0