title: Help with a sql search query using a comma delimitted parameter
body: <p>I am looking for something like this but can't figure out the best way to write the query:</p>
  
  <pre><code>SELECT DISTINCT CategoryID FROM tbl_Categories c INNER JOIN 
    mappingTable mp ON c.CategoryID = mp.CategoryID INNER JOIN
    SubCategories sc ON mp.SubCategoryID = sc.SubCategoryID
  WHERE sc.SubcategoryID IN ALL (234,245,645)
  </code></pre>
  
  <p>I am currently building a dynamic query since the IDs are passed in as a comma delimitted string '234,245,645'  But as we all know there is no such thing as ALL.  Basically I want to return all Categories that are have all of the sub categories in the list.  Hope this makes sense.  </p>