From 2ff6c583f6ecd8a18160e5711f1303f55d98bdb1 Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Wed, 16 Oct 2024 14:23:16 -0500 Subject: [PATCH] Pick latest record (#105) --- models/staging/stg_history_assets.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/staging/stg_history_assets.sql b/models/staging/stg_history_assets.sql index 95f437b..05cc79e 100644 --- a/models/staging/stg_history_assets.sql +++ b/models/staging/stg_history_assets.sql @@ -10,7 +10,7 @@ with select * , row_number() over ( - partition by asset_id order by batch_run_date asc + partition by asset_id order by batch_run_date desc ) as dedup_oldest_asset from {{ source('crypto_stellar', 'history_assets_staging') }} )