title: Get previous row's value on a MySQL view
body: <p>Assuming I have something like this :</p>
  
  <p>MySQL table</p>
  
  <pre><code>Date        |   Val   
  2013/11/22  |   2     
  2013/11/23  |   4     
  2013/11/25  |   12    
  2013/11/30  |   28    
  2013/12/02  |   2     
  </code></pre>
  
  <p>I need a query to get on an other column the sum of the "current" row's value plus the previous row's value.
  With the example, the result would be something like this :</p>
  
  <pre><code>Date        |   Value   |  Total
  2013/11/22  |   2       |  2
  2013/11/23  |   4       |  6          &lt;--- Because 4+2 = 6
  2013/11/25  |   12      |  16
  2013/11/30  |   28      |  40
  2013/12/02  |   2       |  30
  </code></pre>
  
  <p>The problem is that I can't use variables because I'm on <strong>a view.</strong></p>
  
  <p>How can I do this ?</p>
  
  <p>Any help is appreciated.</p>