title: Postgres: Find a record with one specific value in the field
body: <p>I have a table like this:</p>
  <pre><code>ID | Type
  ----------
   1 | Web
   1 | App
   2 | Web
   2 | Web
   3 | App
  </code></pre>
  <p>I want to get the IDs that have only 'Web' as the type.
  I have tried this:</p>
  <pre><code>SELECT id FROM tbl
  GROUP BY 1
  HAVING COUNT(DISTINCT type) = 1
  </code></pre>
  <p>But this gives me all IDs irrespective of type being 'Web' or not.</p>
  <p>My expected output is this:</p>
  <pre><code>ID | Type
  ----------
   2 | Web
  </code></pre>