1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

Question on finding difference between row values

Discussion in 'SQL - Questions and Answers' started by Patrick, Jun 13, 2009.

  1. Patrick New Member

    I have a table that stores data continuously throughout the day. The values continue to increment with each new entry.

    DateTime Value
    2009-06-13 00:50:27.467 390
    2009-06-13 00:57:43.830 435
    2009-06-13 01:05:00.193 479
    2009-06-13 01:12:16.557 512
    2009-06-13 01:19:32.920 567

    I need to take the difference between each row entry and write it to another table with its associated timestamp of the largest number (i.e. 435-390=45).

    DateTime Value
    2009-06-13 00:57:43.830 45
    2009-06-13 01:05:00.193 44
    2009-06-13 01:12:16.557 33
    2009-06-13 01:19:32.920 55
  2. my_s_e_l_f New Member

    What database? what version ?

Share This Page