obtain the difference between successive rows

From: ochaussavoine <olivier(dot)chaussavoine(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: obtain the difference between successive rows
Date: 2012-10-20 10:54:22
Message-ID: 1350730462060-5729149.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I have a table 'tmvt' with a field 'created' in the row, and would like to
compute the difference between successive rows. The solution I found is:

It is complicate and very long to perform. The problem could be simply
solved with MySql by creating a new field and updating it using a statement
with @.
I beleive this is a common problem for users. Do you know a simpler solution
with postgreSql?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/obtain-the-difference-between-successive-rows-tp5729149.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2012-10-20 11:02:17 Re: obtain the difference between successive rows
Previous Message Thalis Kalfigkopoulos 2012-10-19 17:34:14 pgwatch: installs but doesn't display anything