Select ….. where …. OR

Question :

Select ….. where …. OR,

Answer :

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.


Sure thing, the simplest way is this:

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

That’s the answer Select ….. where …. OR, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  Best format for displaying rendered time on a webpage

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you