sommererdbeere
Programmer
hi, i have the same problems again for duplication. is there any way i can resolve it besides outer join?
i have 2 tables, but the data got repeated when i put it together and there is only 1 field from both table that has similarity.
i'm using oracle 8 as database
table 1: cust
pn cust_no qty
pp1234 12013 90000
pp1234 12013 3355
pp1234 12022 6788
pp1234 12066 2545
pp1234 12066 234
table 2: invent
pn loc lot qtyon
pp1234 HK hp234 4000
pp1234 HK hp234-9 300
my sql:
select
c.pn c_pn,
c.cust_no c_cust_no,
c.qty c_qty,
i.pn i_pn,
i.loc i_loc,
i.lot i_lot,
i.qtyon i_qtyon
from cust c, invent i
where c.pn(+) = i.pn
the outcome i got:
c_pn c_cust_no c_qty i_pn i_loc i_lot i_qtyon
pp1234 12013 90000 pp1234 HK hp234 4000
pp1234 12013 3355 pp1234 HK hp234 4000
pp1234 12022 6788 pp1234 HK hp234 4000
pp1234 12066 2545 pp1234 HK hp234 4000
pp1234 12066 234 pp1234 HK hp234 4000
pp1234 12013 90000 pp1234 HK hp234-9 300
pp1234 12013 3355 pp1234 HK hp234-9 300
pp1234 12022 6788 pp1234 HK hp234-9 300
pp1234 12066 2545 pp1234 HK hp234-9 300
pp1234 12066 234 pp1234 HK hp234-9 300
from the above, i've separate an empty space to tell taht the bottom one or the above one is repeated.
please help.. i've try using partition, but in this case, it won't work 'coz some of the customer no might be repeated.
thank u thank u for those who help.. please help me for those who knew.. tahnk u thank u
m
i have 2 tables, but the data got repeated when i put it together and there is only 1 field from both table that has similarity.
i'm using oracle 8 as database
table 1: cust
pn cust_no qty
pp1234 12013 90000
pp1234 12013 3355
pp1234 12022 6788
pp1234 12066 2545
pp1234 12066 234
table 2: invent
pn loc lot qtyon
pp1234 HK hp234 4000
pp1234 HK hp234-9 300
my sql:
select
c.pn c_pn,
c.cust_no c_cust_no,
c.qty c_qty,
i.pn i_pn,
i.loc i_loc,
i.lot i_lot,
i.qtyon i_qtyon
from cust c, invent i
where c.pn(+) = i.pn
the outcome i got:
c_pn c_cust_no c_qty i_pn i_loc i_lot i_qtyon
pp1234 12013 90000 pp1234 HK hp234 4000
pp1234 12013 3355 pp1234 HK hp234 4000
pp1234 12022 6788 pp1234 HK hp234 4000
pp1234 12066 2545 pp1234 HK hp234 4000
pp1234 12066 234 pp1234 HK hp234 4000
pp1234 12013 90000 pp1234 HK hp234-9 300
pp1234 12013 3355 pp1234 HK hp234-9 300
pp1234 12022 6788 pp1234 HK hp234-9 300
pp1234 12066 2545 pp1234 HK hp234-9 300
pp1234 12066 234 pp1234 HK hp234-9 300
from the above, i've separate an empty space to tell taht the bottom one or the above one is repeated.
please help.. i've try using partition, but in this case, it won't work 'coz some of the customer no might be repeated.
thank u thank u for those who help.. please help me for those who knew.. tahnk u thank u
m