title: Postgres aggregate problem
body: <p>I'm not sure why this won't work:</p>
  
  <pre><code>SELECT u.id, u.tag, u.unit_type, Count(p.id) AS num_points
  FROM ot2.unit u
  INNER JOIN ot2.point p on p.unit_id = u.id
  GROUP BY u.id
  HAVING Count(p.id) &gt; 800;
  </code></pre>
  
  <blockquote>
    <p>ERROR: column "u.tag" must appear in the GROUP BY clause or be used in an aggregate function
    SQL state: 42803</p>
  </blockquote>
  
  <p>I have already provided a column for group by.</p>