Re: Need to subtract values between previous and current row

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: Need to subtract values between previous and current row
Дата
Msg-id 294943.92264.qm@web31801.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: Need to subtract values between previous and current row  (Ragnar <gnari@hive.is>)
Список 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 по дате отправления:

Предыдущее
От: Ragnar
Дата:
Сообщение: Re: Need to subtract values between previous and current row
Следующее
От: "Ashish Ahlawat"
Дата:
Сообщение: Re: join and sort on 'best match'