Re: Need to subtract values between previous and current row - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: Need to subtract values between previous and current row
Date
Msg-id 294943.92264.qm@web31801.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Need to subtract values between previous and current row  (Ragnar <gnari@hive.is>)
List pgsql-sql
> not bad, except you miss the initial state for each cid,
> and I do not see how you get the final duration.
>  cid | duration | state 
> -----+----------+-------
>  101 |        2 |     1
>  101 |        2 |     2
>  101 |        3 |     1
>  101 |        3 |     2
>  102 |        2 |     1
>  102 |        2 |     2
>  102 |        2 |     3
> (7 rows)

Good catch!  I should have read the requirements a little more closely, but at 4:30 am when I just
woke up, slight details are very hard for me to focus on. :o)

Regards,
Richard Broersma Jr.


pgsql-sql by date:

Previous
From: Ragnar
Date:
Subject: Re: Need to subtract values between previous and current row
Next
From: "Ashish Ahlawat"
Date:
Subject: Re: join and sort on 'best match'