title: SQL - WHERE Condition on SUM()
body: <p>Is it possible to do something like this:</p>
  
  <pre><code>SELECT 
    `e`.*, 
    `rt`.`review_id`, 
    (SUM(vt.percent) / COUNT(vt.percent)) AS rating 
  FROM `catalog_product_entity` AS `e` 
  INNER JOIN `rating_option_vote` AS `vt`
    ON vt.review_id = e.review_id 
  WHERE (rating &gt;= '0') 
  GROUP BY `vt`.`review_id`
  </code></pre>
  
  <p>In particular I would like to put a where condition on the division result value</p>