| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 
 | CREATE OR REPLACE VIEW V_DAILY_OPEN AS
SELECT risk ,soci,sum(dpl_posit.mtm_pl) as cash,0 as future,0 as options,0 as inventorie,0 as freit,0 as forex
from dpl_posit
group by risk,soci
UNION
select risk,soci,0 as cash,sum(dpl_futures.mkt_price)as future,0 as options,0 as inventorie,0 as freit,0 as forex
from dpl_futures
group by risk,soci
union
select risk,soci,0 as cash,0 as future,sum(dpl_options.mkt_prime) as options,0 as inventorie,0 as freit,0 as forex
from dpl_options
group by risk,soci
union
select risk,soci ,0 as cash,0 as future,0 as options,sum(dpl_stock.mkt_price)as inventorie,0 as freit,0 as forex
from dpl_stock
group by risk,soci
union
select risk,soci,0 as cash,0 as future,0 as options,0 as inventorie,sum(dpl_fret.mkt_price) as freit,0 as forex
from dpl_fret
group by risk,soci
union
select risk,soci ,0 as cash,0 as future,0 as options,0 as inventorie,0 as freit,sum(dpl_forex.mkt_price)as forex
from dpl_forex
group by risk,soci | 
Partager