title: use mysql SUM() in a WHERE clause
body: <p>suppose I have this table</p>
  
  <pre><code>id | cash 
  1    200
  2    301
  3    101
  4    700
  </code></pre>
  
  <p>and I want to return the first row in which the sum of all the previous cash is greater than a certain value: </p>
  
  <p>So for instance, if I want to return the first row in which the sum of all the previous cash is greater than 500, is should return to row 3</p>
  
  <p>How do I do this using mysql statement?</p>
  
  <p>using <code>WHERE SUM(cash) &gt; 500</code>
  doesn't work</p>