spicysudhi
Programmer
Table1: customer
custid cust_chnl
1 A
Table2: Channel
chnlid CustChnl warehouse def_qty
AAA A AA 100
Table3: Order
ordno custid warehouse qty
1 1 AA 10
2 1 AC 15
Output required:
ordno custid def_qty
1 1 100
2 1 50
Here Channel table may hav a record combination of custChnl and warehouse or may not. If exists i need to take the def_qty from there else have a constant value of 50.
the problem i am facing is I am not able put the outer join for Channel table from both Order and Customer.
select
o.ordno, o.custid, nvl(ch.def_qty,50)
from
order o, customer c, channel ch
where
o.custid= c.custid and
o.warehouse=ch.warehouse (+) and
ch.cust_chnl = ch.cust_chnl (+);
please help.
regards,
sudhi
custid cust_chnl
1 A
Table2: Channel
chnlid CustChnl warehouse def_qty
AAA A AA 100
Table3: Order
ordno custid warehouse qty
1 1 AA 10
2 1 AC 15
Output required:
ordno custid def_qty
1 1 100
2 1 50
Here Channel table may hav a record combination of custChnl and warehouse or may not. If exists i need to take the def_qty from there else have a constant value of 50.
the problem i am facing is I am not able put the outer join for Channel table from both Order and Customer.
select
o.ordno, o.custid, nvl(ch.def_qty,50)
from
order o, customer c, channel ch
where
o.custid= c.custid and
o.warehouse=ch.warehouse (+) and
ch.cust_chnl = ch.cust_chnl (+);
please help.
regards,
sudhi