Using SQL SELECT WITH multiple ORs

Hi there,
I am constructing a large query statement and I want this query to be in the format
select * from myTable WHERE ("long_conditions" AND id=115) OR ("long_conditions" AND id=116) OR  ("long_conditions" AND id=117)  ;
Is there a concise way to do this?  Thank you.

Here is the one I tried and it seems to get what I want to id=115, but returns everything for id=116, as the OR seems to be applied like  ("long_conditions" AND id=115) OR id=116;
I think I can introduce ( )s and achieve what I want, but it seems the query string is going to be really large.

SELECT LogID, Type, Event, strftime('%d/%m/%Y',Time,'unixepoch','localtime'), strftime('%H:%M',Time,'unixepoch','localtime'), time(Duration,'unixepoch'), Line FROM myTable WHERE datetime(Time,'unixepoch','localtime') >=date('2015-05-05') AND datetime(Time,'unixepoch','localtime') <=date('2015-05-06') AND time(Time,'unixepoch','localtime') > time('01:00') AND time(Time,'unixepoch','localtime') < time('23:00') AND time(Duration,'unixepoch') > time('00:10:39') AND  id="115" OR id=116;
ambuliAsked:
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.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
You should just be able to do....     WHERE  "long_conditions" AND (id=115 OR id=116 OR id=117)

You can also then make that a little more concise by doing....   WHERE  "long_conditions" AND id IN (115,116,117)
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
ambuliAuthor Commented:
Thank you!
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
You're welcome!
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Mike EghtebasDatabase and Application DeveloperCommented:
or

WHERE  "long_conditions" AND id in(115, 116, 117)
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
@eghtebas,

That was exactly what I wrote in my post. ?
0
Mike EghtebasDatabase and Application DeveloperCommented:
sorry, I just read the first part. My bad.
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Ahhh, no worries. :)
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
MySQL 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.