title: Finding sql records that do have one value, but not others
body: <p>I have a sql table, for the purpose of this post, we will say it has 2 columns, name and value. there are multiple name records with different value entries. There are certain situations where if a value exists for a name, a set of other values must also exist. I am trying to determine where that situation does not occur. For example, if a value of "combo" exists, then a value of "1" and "2" must exist to be in a correct state. I was trying queries like this one:</p>
  
  <pre><code>Select  Name
  From    Table
  Where   Value = "combo"
  And Value Not Exists 
  (
      Select  Name
      From    Table
      Where   Value IN ("1", "2")
  )
  </code></pre>
  
  <p>Is there a better way of doing this?</p>