diff options
| -rw-r--r-- | sql/dawn.sql | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 3d5e2441..dadf5eae 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -721,8 +721,8 @@ SELECT DISTINCT ON (a.dealid) a.dealid, a.security_id, c.maturity, a.initial_margin_percentage, b.date, b.delta, b.gamma, b.vega, b.theta, c.index, c.series, c.tenor, d.duration FROM swaptions a -JOIN (SELECT * FROM swaption_marks where date <= p_date) b USING (dealid) -JOIN index_desc c ON a.security_id=redindexcode AND a.maturity=c.maturity +LEFT JOIN (SELECT * FROM swaption_marks where date <= p_date) b USING (dealid) +LEFT JOIN index_desc c ON a.security_id=redindexcode AND a.maturity=c.maturity LEFT JOIN (SELECT * FROM index_quotes WHERE date=p_date) d USING (index, series, tenor, version) WHERE (termination_date IS NULL OR termination_date > p_date) AND a.expiration_date > p_date AND trade_date <= p_date |
