select AA.LID,AA.LBID,AA.LTRANSNO,AA.LORGID,AA.LBIGID,AA.LWEIGHT,AA.LNEWWEIGHT,AA.LVERNO,AA.LSTATE,
BB.Description,
CC.vendor_name
from
Wl_Pos_stockBack_line_Tb AA,
(Select pc.FLEX_VALUE,pc.Description From wl_pos_item_class_v pc Where pc.item_class= 'big_class ') BB,
(Select segment1,vendor_name From apps.po_vendors) CC
Where AA.LBIGID=BB.FLEX_VALUE And AA.LVERNO=CC.SEGMENT1 And LBID=31
以上是我现在的错误的方法
当AA.LBIGID!=BB.FLEX_VALUE ||AA.LVERNO!=CC.SEGMENT1 这个时候这段代码
就没有数据了!
但是我还是需要这些数据!把不存在的数据用空去代替!!1求解!!111
------解决方案--------------------
左连接 + nvl 函数
------解决方案--------------------
你这个代码写的太乱了,不知道这样写可以不
select AA.LID,AA.LBID,AA.LTRANSNO,AA.LORGID,AA.LBIGID,AA.LWEIGHT,AA.LNEWWEIGHT,
AA.LVERNO,AA.LSTATE,BB.Description,CC.vendor_name
from Wl_Pos_stockBack_line_Tb AA,wl_pos_item_class_v BB,apps.po_vendors CC
where AA.LBIGID=nvl(BB.FLEX_VALUE,AA.LBIGID) And AA.LVERNO=nvl(CC.SEGMENT1,AA.LVERNO)
And aa.LBID=31 and BB.item_class= 'big_class ';