title: SQL/Sybase: SELECT ... GROUP BY ... NOT HAVING?
body: <pre><code>col1   col2
  A      bear
  A      dog
  A      cat
  B      bear
  B      dog
  B      cat
  C      dog
  C      cat
  D      bear
  D      dog
  D      cat
  E      bear
  E      dog
  E      cat
  F      dog
  F      cat
  </code></pre>
  
  <p>if I wanted to select all of the col1 values that have at least one row where <code>col2 = 'bear'</code>, I can do:</p>
  
  <pre><code>SELECT col1 
  FROM mytable 
  WHERE col1 IN ('A','B','C') 
  GROUP BY col1 
  HAVING col2 = 'bear'
  </code></pre>
  
  <p>which would return A and B</p>
  
  <p>but I want to select only the values from col1 where there isn't a row where <code>col2 = 'bear'</code></p>
  
  <p>I'm thinking <code>NOT HAVING</code>, but that doesn't appear to work. </p>
  
  <p>any ideas? thanks!</p>