aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sql/dawn.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index aece17be..89c8773d 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -1827,8 +1827,8 @@ SELECT tranche_risk.date, tranche_id as trade_id, security_desc, index, series,
tranche_risk.upfront, tranche_risk.running,
index_refprice, index_refspread, index_duration, initial_margin_percentage
FROM tranche_risk
-LEFT join LATERAL
-(SELECT full_globeop_id FROM id_mapping WHERE id_mapping.serenitas_id=tranche_id and date < tranche_risk.date ORDER by date desc LIMIT 1) b ON true
+LEFT JOIN LATERAL
+(SELECT full_globeop_id FROM id_mapping WHERE id_mapping.serenitas_id=tranche_id AND date <= tranche_risk.date ORDER by date desc LIMIT 1) b ON true
LEFT JOIN cds ON (tranche_id=id)
RIGHT JOIN (SELECT invid, periodenddate,
sum(endbookunrealincome) AS globeop_accrued,