title: SQL: Putting condition on result of an aggregate function
body: <p>this thing works fine:</p>
  
  <pre><code>SELECT c.id, c.name, c.ascii_name, COUNT(*) AS nr
      FROM cities c 
      INNER JOIN jobs j ON (j.city_id = c.id ) 
      WHERE j.is_active = 1 
      GROUP BY c.name
  limit 100
  </code></pre>
  
  <p>but when i wanna put condition on new column nr it says column not found</p>
  
  <pre><code>SELECT c.id, c.name, c.ascii_name, COUNT(*) AS nr
      FROM cities c 
      INNER JOIN jobs j ON (j.city_id = c.id ) 
      WHERE j.is_active = 1 and nr &gt; 100
      GROUP BY c.name
  limit 100
  </code></pre>