title: SQL to get clients that do not belong to categories
body: <p>Suppose my table is as follows,</p>
  <pre><code>id category
  1   a
  5   a
  5   b
  4   NULL
  6   b
  6   c
  7   a
  7   d
  </code></pre>
  <p>I want to get ids that do not belong to group &quot;a&quot; as a result</p>
  <pre><code>id category
  4   NULL
  6   b, c
  
  </code></pre>
  <p>What is the most elegant way to do this.
  Now I use something like that, but my result is not exactly what I need. As this also gets ids 5 and 7</p>
  <pre><code>SELECT g.id, g.category
  FROM groups g
  WHERE (g.category&lt;&gt;'a' OR g.category IS NULL)
  </code></pre>