aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sql/dawn.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 89c8773d..52d10548 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -2037,3 +2037,12 @@ WITH temp AS (
FROM tranche_risk JOIN cds ON tranche_id=id
)
SELECT date, fund, tranche_id, daily_pnl, sum(daily_pnl) OVER (PARTITION BY tranche_id, date_trunc('month', date) ORDER BY date) AS mtd_pnl FROM temp;
+
+
+create table id_mapping(
+ date date not null,
+ trade_type text not null,
+ serenitas_id int not null,
+ globeop_id int not null,
+ full_globeop_id text GENERATED ALWAYS AS (trade_type||lpad(globeop_id::text, 6, '0')|| 'K00SCLMA') stored
+);