title: Subtracting sequential values with MySql stored procedure
body: <p>Starting with an ordered set of floating point values (the order matters) that can be retrieved with a simple query. I want to calculate sequential differences of values with a stored procedure. For instance,</p>
  
  <p>if we have the values</p>
  
  <p>1, 3, 7</p>
  
  <p>the result should be</p>
  
  <p>2, 4</p>
  
  <p>What is the easiest way to do this with a stored procedure (Mysql 5)?</p>