Commit all views for ITSA
This commit is contained in:
24
Database Backups/SQL Views/vw_bi_dim_trade.sql
Normal file
24
Database Backups/SQL Views/vw_bi_dim_trade.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
CREATE OR REPLACE VIEW public.vw_bi_dim_trade AS
|
||||
SELECT pc."intPurchaseLineId" AS "intTradeId",
|
||||
'Physical'::text AS "Trade Category",
|
||||
'Purchase'::text AS "Trade Type",
|
||||
pc."strReference" AS "Trade Ref",
|
||||
pc."dtmContractDate" AS "Trade Date",
|
||||
pc."strCounterparty" AS "Counterparty",
|
||||
pc."strRegion" AS "Bassin",
|
||||
pc."strBookName" AS "Book",
|
||||
pc."strStrategyName" AS "Strategy"
|
||||
FROM vw_utility_dim_physical_purchase_contract pc
|
||||
WHERE ((1 = 1) AND (pc."intPurchaseLineId" > 0))
|
||||
UNION ALL
|
||||
SELECT sc."intSaleLineId" AS "intTradeId",
|
||||
'Physical'::text AS "Trade Category",
|
||||
'Sale'::text AS "Trade Type",
|
||||
sc."strReference" AS "Trade Ref",
|
||||
sc."dtmContractDate" AS "Trade Date",
|
||||
sc."strCounterparty" AS "Counterparty",
|
||||
sc."strRegion" AS "Bassin",
|
||||
sc."strBookName" AS "Book",
|
||||
sc."strStrategyName" AS "Strategy"
|
||||
FROM vw_utility_dim_physical_sale_contract sc
|
||||
WHERE ((1 = 1) AND (sc."intSaleLineId" > 0));;
|
||||
Reference in New Issue
Block a user