title: MySQL aggregation function to sum the differences from row to row
body: <p>i've got this lil' mysql table: </p>
  
  <pre><code>+----+-------+
  | id | value |
  +----+-------+
  |  1 |  1240 |
  |  2 |  1022 |
  |  3 |   802 |
  | .. |    .. |
  +------+-----+
  </code></pre>
  
  <p>i'm searching for a sql-query summing up the difference between the rows:</p>
  
  <p>difference of row 1 and 2 + difference of row 2 and 3 + ...</p>
  
  <p>is that possibile with sql?</p>