SQL? Multiple fields in a NOT IN clause


I'm trying to do something like this:

Select A,B,C FROM MyTable WHERE A,B,C NOT IN (Select A,B,C From MyOtherTable)

Is there any syntax that will allow me to check 3 fields in the 2nd select statement ?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Select a.A,a.B,a.C
FROM MyTable a
JOIN MyOtherTable b on a.A <> b.A and a.B <> b.B and a.C <> b.C

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Select A,B,C FROM MyTable t WHERE NOT EXISTS (Select 1 From MyOtherTable o WHERE o.A = t.A AND o.B  = t.B AND o.C = t.C )
Scott PletcherSenior DBACommented:
Select mt.A, mt.B, mt.C
FROM MyTable mt
LEFT OUTER JOIN MyOtherTable mot ON mot.A = mt.A AND mot.B = mt.B AND mot.C = mt.C
WHERE mot.A IS NULL  --only NULL if no match found on MyOtherTable
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.