From 4a6f52b7721b53d039fbe6101fd3e21b67b9bd2c Mon Sep 17 00:00:00 2001 From: Amisha Singla Date: Wed, 16 Oct 2024 10:39:46 -0500 Subject: [PATCH] Pick latest record --- 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') }} )