Link to home
Start Free TrialLog in
Avatar of Charles Baldo
Charles BaldoFlag for United States of America

asked on

Need SQL Query improved for multiple column joins

I have this query

UPDATE Table1  
SET
      CompareFlag = 'Y'
WHERE
      (Table1.doc_id IN
      (
          SELECT Table2.doc_id
          FROM   Table2
          WHERE  (batch_id IS NULL)
      ));


there are two columns in Table1  one and Table2 two that need to be equal

Doc_ID and ObjectID  are in both tables.   So the Table1.doc_id IN (select will not work)

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Charles Baldo

ASKER

That works

Thanks Jim