title: How to get previous record value from MySql Query
body: <p>I want to get previous record value to calculate with current value;</p>
  
  <p>example: current value of col3 will be = (previous col3 value + current col2 value)</p>
  
  <p>Note: It is not important to maintain col1 order. Because the resulted records are fetched by Select query.</p>
  
  <pre><code>col1 | col2 | col3
  ------------------
  a    | 1    | 1
  b    | 2    | 3  &lt;= 1+2
  a    | 1    | 4  &lt;= 3+1
  d    | 3    | 7  &lt;= 4+3
  </code></pre>
  
  <p>I think it is not so hard but I can not solve the problem using mysql</p>