aboutsummaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/dawn.sql5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 16cdf4bf..58a8f904 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -400,10 +400,9 @@ DECLARE
BEGIN
days:=days_accrued(p_date);
RETURN QUERY
-WITH temp AS (SELECT a.*, c.index, c.series, c.version, d.tenor, c.indexfactor/100. AS fact
+WITH temp AS (SELECT a.*, c.index, c.series, c.version, c.tenor, c.indexfactor/100. AS fact
FROM list_cds_positions(p_date) a
- LEFT JOIN index_version c ON a.security_id=c.redindexcode
- LEFT JOIN index_desc d USING (redindexcode, maturity)),
+ LEFT JOIN index_desc c ON (a.security_id=c.redindexcode AND a.maturity=c.maturity)),
index_price AS (SELECT index, series, version, tenor, closeprice, index_quotes.duration
FROM index_quotes WHERE date=p_date)
SELECT temp.security_id, temp.security_desc, temp.maturity, temp.notional, temp.fact, temp.fixed_rate/100,