aboutsummaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/et_tables.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/et_tables.sql b/sql/et_tables.sql
index 3be0d41b..de43439f 100644
--- a/sql/et_tables.sql
+++ b/sql/et_tables.sql
@@ -346,7 +346,7 @@ CREATE OR REPLACE FUNCTION et_aggdealinfo (p_dealname varchar(10))
bool_or(c.secondlien)) AS secondlien, bool_or(a.iscdo) AS iscdo,
bool_or(a.defaultedflag) AS defaultedflag FROM et_latestdealinfo(p_dealname) a
LEFT JOIN latest_markit_prices2 b ON coalesce(a.ET_LoanXID, a.loanxid) = b.loanxid
- LEFT JOIN bloomberg_corp c ON a.cusip=c.cusip WHERE a.ReinvFlag IS NOT TRUE
+ LEFT JOIN bloomberg_corp c ON coalesce(a.cusip, a.ET_cusip)=c.cusip WHERE a.ReinvFlag IS NOT TRUE
GROUP BY a.issuername, a.maturity, a.loanxid, a.fixedorfloat,
a.frequency, a.cusip ORDER BY issuername;
END;
@@ -418,7 +418,7 @@ CREATE OR REPLACE FUNCTION et_aggdealinfo_historical (p_dealname varchar(10), p_
bool_or(a.defaultedflag) AS defaultedflag, a.et_loanxid, a.et_cusip
FROM et_historicaldealinfo(p_dealname, p_date) a
LEFT JOIN historical_markit_prices2(p_date) b ON coalesce(a.ET_LoanXID, a.loanxid)=b.loanxid
- LEFT JOIN historical_bloomberg_corp(p_date) c ON a.cusip=c.cusip
+ LEFT JOIN historical_bloomberg_corp(p_date) c ON coalesce(a.cusip, a.ET_cusip)=c.cusip
WHERE a.ReinvFlag IS NOT TRUE
GROUP BY a.issuername, a.maturity, a.loanxid, a.fixedorfloat,
a.frequency, a.cusip, a.et_loanxid, a.et_cusip ORDER BY issuername;