Need to subtract values between previous and current row

From: "Partha Guha Roy" <partha(dot)guha(dot)roy(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Need to subtract values between previous and current row
Date: 2006-12-15 12:27:35
Message-ID: 6bdfe880612150427o19bfe90ch87a972c0f5898ffb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I have a table that contains data like this:

ID ATIME (MM/dd/yyyy)
== ====
1 10/12/2006
2 10/14/2006
3 10/18/2006
4 10/22/2006
5 10/30/2006

Now I need a query that will subtract atime of row 1 from row 2, row2 from
row3 and so on...

Can anyone please help?

Regards.

--
------------------------------
Partha Guha Roy
***********************************************
Take everything you like seriously, except yourselves.
- Rudyard Kipling

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ragnar 2006-12-15 13:01:50 Re: Need to subtract values between previous and current row
Previous Message Markus Schaber 2006-12-14 15:36:59 Re: join and sort on 'best match'