title: Difference between rows Mysql Query
body: <p>I have one table which is having four fields:</p>
  
  <pre><code>trip_paramid, creation_time, fuel_content,vehicle_id
  </code></pre>
  
  <p>I want to find the difference between two rows.In my table i have one field fuel_content.Every two minutes i getting packets and inserting to database.From this i want to find out total refuel quantity.If fuel content between two packets is greater than 2,i will treat it as refueling quantity.Multiple refuel may happen in same day.So i want to find out total refuel quantity for a day for a vehicle.I created one table schema&amp;sample data in sqlfiddle. Can anyone help me to find a solution for this.here is the link for table schema..<a href="http://www.sqlfiddle.com/#!2/4cf36" rel="nofollow">http://www.sqlfiddle.com/#!2/4cf36</a></p>