title: SQL Query to match a subset of data
body: <p>I have a table that looks like:</p>
  
  <pre><code>CLASS   VALUE
  1       A
  1       B
  1       C
  2       A
  2       C
  3       B
  3       D
  4       A
  5       C
  5       A
  </code></pre>
  
  <p>I have a user-submitted data-set of values that I want to find any classes whose values are a subset of the user-submitted data-set. </p>
  
  <p>For example, </p>
  
  <p>If data-set was <code>A</code>, <code>B</code>, and <code>C</code> then the results would be class <code>1</code>, <code>2</code>, <code>4</code>, and <code>5</code>. </p>
  
  <p>If data-set was <code>A</code> and <code>C</code> the results would be class <code>2</code>, <code>4</code>, and <code>5</code>. </p>
  
  <p>If data-set was <code>A</code>, then result would be class <code>4</code>. </p>
  
  <p>The platform I am on is SQL Server, but really any SQL-based answer would be best. </p>