title: SQL query over multiple inputs
body: <p>I've got table containing a number of text columns, and need to be able to query the table using a search term. For single terms, this is simple...</p>
  
  <pre><code>SELECT * FROM things WHERE @searchTerm in (column1, column2...columnX)
  </code></pre>
  
  <p>However, sometimes I need to search over multiple terms in a single query, something like...</p>
  
  <pre><code>SELECT * FROM things WHERE @searchTerms in (column1, column2...columnX)
  </code></pre>
  
  <p>...where <code>@searchTerms</code> is a collection of values, rather than a single value. Is there a way to emulate this behaviour in SQL?</p>
  
  <p>UPDATE:
  Thank you @Tedo G., unfortunately I need the query to use <code>AND</code> between the different terms. To do that I've added a change to yours to group the results and ensure the count per distinct result matches the number of terms...</p>
  
  <pre><code>SELECT 
       * 
  FROM 
       things AS A INNER JOIN @searchTerms AS B
            ON B.[FieldName] IN (column1, column2...columnX)
       GROUP BY column1, column2...columnX
       HAVING count(column1) = @numberOfSearchTerms
  </code></pre>
  
  <p>...this works, but is there a better way?</p>