Why am I getting bigger dataset when the first code snippets executes?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frank Mohan

    Why am I getting bigger dataset when the first code snippets executes?

    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))
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Do you have duplicate that could affect your INNER JOINs?

    ~~ CK

    Comment

    Working...