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

<p>Example: I would typically write a statement such as:</p>

<pre><code>select * from TABLE where field = 1 or field = 2 or field = 3
</code></pre>

<p>Is there a way to instead say something like:</p>

<pre><code>select * from TABLE where field = 1 || 2 || 3
</code></pre>

<p>Any help is appreciated.</p>

[{'answer_id': 17872, 'author': 'mercutio', 'author_id': 1951, 'author_profile': 'https://Stackoverflow.com/users/1951', 'pm_score': 6, 'selected': True, 'text': '<p>Sure thing, the simplest way is this:</p>\n\n<pre><code>select foo from bar where baz in (1,2,3)\n</code></pre>\n'}, {'answer_id': 17873, 'author': 'Michael Stum', 'author_id': 91, 'author_profile': 'https://Stackoverflow.com/users/91', 'pm_score': 3, 'selected': False, 'text': '<pre><code>select * from TABLE where field IN (1,2,3)\n</code></pre>\n\n<p>You can also conveniently combine this with a subquery that only returns one field:</p>\n\n<pre><code>    select * from TABLE where field IN (SELECT boom FROM anotherTable)\n</code></pre>\n'}, {'answer_id': 17874, 'author': 'Mike Polen', 'author_id': 212, 'author_profile': 'https://Stackoverflow.com/users/212', 'pm_score': 2, 'selected': False, 'text': '<p>select * from TABLE where field in (1, 2, 3)</p>\n'}, {'answer_id': 17875, 'author': 'Lasse V. Karlsen', 'author_id': 267, 'author_profile': 'https://Stackoverflow.com/users/267', 'pm_score': 2, 'selected': False, 'text': '<pre><code>WHERE field IN (1, 2, 3)\n</code></pre>\n'}, {'answer_id': 17887, 'author': 'Can Berk Güder', 'author_id': 2119, 'author_profile': 'https://Stackoverflow.com/users/2119', 'pm_score': 3, 'selected': False, 'text': '<p>OR:</p>\n\n<pre><code>SELECT foo FROM bar WHERE baz BETWEEN 1 AND 3\n</code></pre>\n'}, {'answer_id': 17895, 'author': 'Re0sless', 'author_id': 2098, 'author_profile': 'https://Stackoverflow.com/users/2098', 'pm_score': 1, 'selected': False, 'text': "<p>You can still use in for</p>\n\n<pre><code>select *\nfrom table\nwhere field  = '1' or field = '2' or field = '3'\n</code></pre>\n\n<p>its just</p>\n\n<pre><code>select * from table where field in ('1','2','3')\n</code></pre>\n"}, {'answer_id': 54392634, 'author': 'S.Witch', 'author_id': 10905600, 'author_profile': 'https://Stackoverflow.com/users/10905600', 'pm_score': 0, 'selected': False, 'text': "<p>while <code>in</code> is a shortcut for <code>or</code> and I wasn't sure how I could combine <code>in</code> with <code>and</code>, I did it this way</p>\n\n<pre><code> SELECT * FROM table\n WHERE column1='x' AND (column2='y' OR column2='z');\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/17870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2116/']