diff options
Diffstat (limited to 'sql/dawn.sql')
| -rw-r--r-- | sql/dawn.sql | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 81507e75..0501a155 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -231,6 +231,11 @@ BEGIN END; $$ LANGUAGE plpgsql; +CREATE OR REPLACE VIEW orig_cds AS +SELECT DISTINCT ON (dealid) dealid, folder, index, series, version, tenor, fixed_rate, notional, upfront, +protection, attach, detach, trade_date, upfront_settle_date FROM cds +JOIN index_desc ON index_desc.redindexcode=cds.security_id AND index_desc.maturity=cds.maturity +ORDER BY dealid, trade_date DESC; CREATE OR REPLACE function query_positions(p_type text DEFAULT NULL) RETURNS text AS $$ |
