title: Exclude whole group based on single value
body: <p>Table T</p>
  
  <pre><code>CID Code
  1    A
  1    B
  1    C
  2    C
  2    A
  2    B
  3    A
  3    D
  </code></pre>
  
  <p>I want the output to have only those CID groups where <code>Code &lt;&gt; 'C'</code></p>
  
  <p>Desired Output:</p>
  
  <pre><code>CID  Code
  3     A
  3     D
  </code></pre>
  
  <p>Query Attempt:</p>
  
  <pre><code>SELECT DISTINCT
           CID
          ,Code
  FROM Table T
  WHERE Code &lt;&gt; 'C'
  </code></pre>
  
  <p>But this will exclude rows where Code = C, not the entire groups where Code = C.
  Not sure how <code>GROUP BY</code> could work here</p>