oracle 左连接 . 如果一边的没有记录, nvl (右边,0) 否则会造成整列无法,无数据.

oracle 左连接 . 如果一边的没有记录, nvl (右边,0) 否则会造成整列无法,无数据.



左连接 .如果一边的没有记录, nvl (右边,0) 否则会造成整列无法,无数据.

 1
 2 select  d.crunit_   -  nvl( a.stkamt_ , 0
 3 from  dl_fundetf d , 
 4 ( select  c.stkcode_, c.exchgcode_,c.stkamt_ ,c.stkcost_ 
 5 from  acc_proflstk c 
 6 where   1 = 1
 7 and  c.fundid_  =   ' 55 '
 8 and  c.cellid_  =   ' 50001 '
 9 and  c.proflid_  =   ' 080724113732 '
10 )  a 
11 where   1 = 1  
12 and  d.exchgcode_  =   ' SH '
13 and  d.fundid_  =   ' 510051 '
14 and   a.exchgcode_ ( + ) =  d.exchgcode_
15 and   a.stkcode_  ( + ) =    d.fundid_ 

你可能感兴趣的:(oracle 左连接 . 如果一边的没有记录, nvl (右边,0) 否则会造成整列无法,无数据.)