From 479fea7da6011cbb17ec0a21138fa7318a46ee4c Mon Sep 17 00:00:00 2001 From: Simon Chow Date: Tue, 23 Jan 2024 13:51:20 -0500 Subject: [PATCH] Update joins --- models/marts/trade_agg.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/models/marts/trade_agg.sql b/models/marts/trade_agg.sql index 54f5004..f1c6929 100644 --- a/models/marts/trade_agg.sql +++ b/models/marts/trade_agg.sql @@ -101,19 +101,19 @@ with from trade_yearly as join_table_yearly left join trade_weekly as join_table_weekly - on join_table_daily.day_agg = join_table_weekly.day_agg - and join_table_daily.asset_a = join_table_weekly.asset_a - and join_table_daily.asset_b = join_table_weekly.asset_b + on join_table_yearly.day_agg = join_table_weekly.day_agg + and join_table_yearly.asset_a = join_table_weekly.asset_a + and join_table_yearly.asset_b = join_table_weekly.asset_b left join trade_monthly as join_table_monthly - on join_table_daily.day_agg = join_table_monthly.day_agg - and join_table_daily.asset_a = join_table_monthly.asset_a - and join_table_daily.asset_b = join_table_monthly.asset_b + on join_table_yearly.day_agg = join_table_monthly.day_agg + and join_table_yearly.asset_a = join_table_monthly.asset_a + and join_table_yearly.asset_b = join_table_monthly.asset_b left join trade_daily as join_table_daily - on join_table_daily.day_agg = join_table_yearly.day_agg - and join_table_daily.asset_a = join_table_yearly.asset_a - and join_table_daily.asset_b = join_table_yearly.asset_b + on join_table_yearly.day_agg = join_table_daily.day_agg + and join_table_yearly.asset_a = join_table_daily.asset_a + and join_table_yearly.asset_b = join_table_daily.asset_b ) select *