MSSQL 2012 - apply IN to multiple fields

Hey there!

I'm trying to write a query that will check multiple fields for the same set of criteria.  
For example:
I want to check fields A, B, C, and D for any of the values IN (1,2,3,4).  
I think I can do something like this:
SELECT COUNT(*) FROM MyTable
WHERE
A IN (1,2,3,4) OR
B IN (1,2,3,4) OR
C IN (1,2,3,4) OR
D IN (1,2,3,4);

But I'm wondering if there's a cleaner way to do it - something like:
SELECT COUNT(*) FROM My Table
WHERE
A OR B OR C OR D IN (1,2,3,4);

Is there a cleaner way?

Thanks!
LVL 1
ttist25Asked:
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.

Vitor MontalvãoMSSQL Senior EngineerCommented:
I don't think there's a better way to do it besides what you've presented.
0
Mark WillsTopic AdvisorCommented:
Agreed...

Check each column separately  IN(1,2,3,4)

There might be a very tricky way, which I cant think of just at the moment, which also indicates (to me) that sometimes the best way is the easiest way....
0

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
ttist25Author Commented:
Thanks guys
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.