This code returns 6754 rows:
select a.prodid, a.prodlinetype, a.itemid, a.inventtransid , a.inventreftype , a.inventrefid, a.inventreftran sid, a.vendid,
a.oprnum
from reporting.prodb om a inner join reporting.prodr oute b on a.prodid = b.prodid
inner join reporting.wrkct rtable c on b.wrkctrid = c.wrkctrid where a.dataareaid = 'far'
and a.vendid = '9065'and (b.semqtygood <> 0 or b.semqtyerror <> 0) and b.dataareaid = 'far'
and c.vendid = '9065' and c.dataareaid = 'far'
This code returns 3943 rows:
select prodid, prodlinetype, itemid, inventtransid, inventreftype, inventrefid, inventreftransi d, vendid, oprnum
from reporting.prodb om where dataareaid = 'far' and prodid in (
select prodid from reporting.prodr oute where dataareaid = 'far'
and wrkctrid in (select wrkctrid from reporting.wrkct rtable where dataareaid = 'far' and vendid = '9065')
and (semqtygood <> 0 or semqtyerror <> 0))
select a.prodid, a.prodlinetype, a.itemid, a.inventtransid , a.inventreftype , a.inventrefid, a.inventreftran sid, a.vendid,
a.oprnum
from reporting.prodb om a inner join reporting.prodr oute b on a.prodid = b.prodid
inner join reporting.wrkct rtable c on b.wrkctrid = c.wrkctrid where a.dataareaid = 'far'
and a.vendid = '9065'and (b.semqtygood <> 0 or b.semqtyerror <> 0) and b.dataareaid = 'far'
and c.vendid = '9065' and c.dataareaid = 'far'
This code returns 3943 rows:
select prodid, prodlinetype, itemid, inventtransid, inventreftype, inventrefid, inventreftransi d, vendid, oprnum
from reporting.prodb om where dataareaid = 'far' and prodid in (
select prodid from reporting.prodr oute where dataareaid = 'far'
and wrkctrid in (select wrkctrid from reporting.wrkct rtable where dataareaid = 'far' and vendid = '9065')
and (semqtygood <> 0 or semqtyerror <> 0))
Comment