sommererdbeere
Programmer
Hi,
I always have problems with duplicated/repeated lines. for my sql, i have to join 6 tables to retrieve data.
1st table: so_operation
wc ord# parpart# qty
fj 10023 ws20004 0
fj 10023 ws20004 0
2nd table: so
ord# parpart# qty
10023 ws20004 0
3rd table: so_material
ord# comppart# qtyreq
10023 pw20031 25
4th table: manu_std
parpart# comppart
ws20004 pw200031
5th table: pur_req_line
ord# req#
10023 4337
10023 5123
6th table: routing
parpart# cost
ws20004 0.26
sql statement:
select
soo.wc wc,
soo.ord# ord#,
pr.ord# prord# ,
soo.part# parpart#,
smrs.part# comppart#,
soo.qty soo_qty,
ros.part# ros_part# ,
from so_operation SOO, so so,
so_material SMRS, manu_std ms,
pur_req_line pr, routing ros
where smrs.ord# = soo.ord# and
pr.ord# = soo.ord# and
smrs.ord# = so.ord# and
ms.part# = soo.part# and
ros.part# = soo.part# and
so.state != 'Can'
from the above sql, it gives me the following output:
wc ord# prord# parpart# comppart# soo_qty ros_art# req#
fj 10023 10023 ws20004 pw20031 0 ws20004 4337
fj 10023 10023 ws20004 pw20031 0 ws20004 5123
fj 10023 10023 ws20004 pw20031 0 ws20004 4337
fj 10023 10023 ws20004 pw20031 0 ws20004 5123
the bottom 2 lines are repeated..
if anybody can help me on this, it will be great & awesome, because i try to fidn the solution to this for more than a day already..
million thanks for those who help me..
many many many thanks
m
I always have problems with duplicated/repeated lines. for my sql, i have to join 6 tables to retrieve data.
1st table: so_operation
wc ord# parpart# qty
fj 10023 ws20004 0
fj 10023 ws20004 0
2nd table: so
ord# parpart# qty
10023 ws20004 0
3rd table: so_material
ord# comppart# qtyreq
10023 pw20031 25
4th table: manu_std
parpart# comppart
ws20004 pw200031
5th table: pur_req_line
ord# req#
10023 4337
10023 5123
6th table: routing
parpart# cost
ws20004 0.26
sql statement:
select
soo.wc wc,
soo.ord# ord#,
pr.ord# prord# ,
soo.part# parpart#,
smrs.part# comppart#,
soo.qty soo_qty,
ros.part# ros_part# ,
from so_operation SOO, so so,
so_material SMRS, manu_std ms,
pur_req_line pr, routing ros
where smrs.ord# = soo.ord# and
pr.ord# = soo.ord# and
smrs.ord# = so.ord# and
ms.part# = soo.part# and
ros.part# = soo.part# and
so.state != 'Can'
from the above sql, it gives me the following output:
wc ord# prord# parpart# comppart# soo_qty ros_art# req#
fj 10023 10023 ws20004 pw20031 0 ws20004 4337
fj 10023 10023 ws20004 pw20031 0 ws20004 5123
fj 10023 10023 ws20004 pw20031 0 ws20004 4337
fj 10023 10023 ws20004 pw20031 0 ws20004 5123
the bottom 2 lines are repeated..
if anybody can help me on this, it will be great & awesome, because i try to fidn the solution to this for more than a day already..
million thanks for those who help me..
many many many thanks
m