We have answer of your question!

100% solved queries, no empty question

Question: Select … where … OR


Is there a way to select data where any one of multiple conditions occur on the same field?

Example: I would typically write a statement such as:

select * from TABLE where field = 1 or field = 2 or field = 3

Is there a way to instead say something like:

select * from TABLE where field = 1 || 2 || 3

Any help is appreciated.

Question author Jessilfp | Source



Sure thing, the simplest way is this:

select foo from bar where baz in (1,2,3)
Answer author Mercutio

Tickanswer.com is providing the only single recommended solution of the question Select … where … OR under the categories i.e mysql , . Our team of experts filter the best solution for you.

You may also add your answer

Thanks for contributing an answer to Tick Answer!