diff --git a/models/silver/streamline/realtime/streamline__blocks_realtime.sql b/models/silver/streamline/realtime/streamline__blocks_realtime.sql index 7e0afa0f..b90962dc 100644 --- a/models/silver/streamline/realtime/streamline__blocks_realtime.sql +++ b/models/silver/streamline/realtime/streamline__blocks_realtime.sql @@ -45,7 +45,11 @@ WITH last_3_days AS ({% if var('STREAMLINE_RUN_HISTORY') %} last_3_days ) AND block_number IS NOT NULL - ) + ) qualify ROW_NUMBER() over ( + PARTITION BY block_number + ORDER BY + _inserted_timestamp DESC + ) = 1 ) SELECT block_number, diff --git a/models/silver/streamline/realtime/streamline__transactions_realtime.sql b/models/silver/streamline/realtime/streamline__transactions_realtime.sql index 57f39f26..86cfa6b3 100644 --- a/models/silver/streamline/realtime/streamline__transactions_realtime.sql +++ b/models/silver/streamline/realtime/streamline__transactions_realtime.sql @@ -45,7 +45,11 @@ WITH last_3_days AS ({% if var('STREAMLINE_RUN_HISTORY') %} last_3_days ) AND block_number IS NOT NULL - ) + ) qualify ROW_NUMBER() over ( + PARTITION BY block_number + ORDER BY + _inserted_timestamp DESC + ) = 1 ) SELECT block_number,