title: Getting a syntax error on my mysql query around doing math with my where function
body: <p>I am trying to select from my database of scores only the scores that are 1 and 5, group those scores by the productid and then do some math on those scores to only pull the productids that have a close number of 1 and 5 scores.  My query is below and I'm getting a syntax error on the 7th line, though I'm not sure what the issue is.  Thank you for any help.</p>
  
  <pre><code>SELECT title, productid,
         count(*) as total,
         sum(case when score = '5.0' then 1 else 0 end) as high,
         sum(case when score = '1.0' then 1 else 0 end) as low
  FROM `reviews`
  WHERE total &gt; 0 AND 
  WHERE (`high` + `low`)/`total` &gt; '.5' AND
  WHERE abs((`high`-`low`)/`low`) &lt;= '.1'
  GROUP BY productid
  ORDER BY total DESC;
  </code></pre>