title: How to combine IN operator with LIKE condition (or best way to get comparable results)
body: <p>I need to select rows where a field begins with one of several different prefixes:</p>
  
  <pre><code>select * from table 
  where field like 'ab%' 
    or field like 'cd%' 
    or field like "ef%" 
    or...
  </code></pre>
  
  <p>What is the best way to do this using SQL in Oracle or SQL Server? I'm looking for something like the following statements (which are incorrect):</p>
  
  <pre><code>select * from table where field like in ('ab%', 'cd%', 'ef%', ...)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>select * from table where field like in (select foo from bar)
  </code></pre>
  
  <p>EDIT:
  I would like to see how this is done with either giving all the prefixes in one SELECT statement, of having all the prefixes stored in a helper table.</p>
  
  <p>Length of the prefixes is not fixed.</p>