日期:2014-05-17 浏览次数:20899 次
select ebpoE.zbthnr as zbthnr1,ebpoE.Zqgdh,
o.zbthnr2,
ebpoE.ebeln,
ebpoE.ebelp from t_sap_eban ebpoE
left join (
select eban.banfn,eban.bnfpo,decode(nvl(ekpo.ebeln_pre, ''),
'',
(select eb.zbthnr
from t_sap_eban eb
where eb.ebeln || '-' || eb.ebelp =
ekpo.konnr || '-' || ekpo.ktpnr
and
eb.loekz is null and rownum =1),
(select eb.zbthnr
from t_sap_eban eb
where eb.ebeln || '-' || eb.ebelp =
ekpo.ebeln_pre || '-' || ekpo.ebelp_pre
and
eb.loekz is null and rownum =1)) as zbthnr2
from t_sap_eban eban, t_sap_ekpo ekpo
&