Re: obtain the difference between successive rows - Mailing list pgsql-general

From Berend Tober
Subject Re: obtain the difference between successive rows
Date
Msg-id 508310EC.8070207@computer.org
Whole thread Raw
In response to Re: obtain the difference between successive rows  (Виктор Егоров <vyegorov@gmail.com>)
List pgsql-general
Виктор Егоров wrote:
> 2012/10/20 Berend Tober <btober@broadstripe.net>:
>> Your suggestion almost worked as is for this, except that you have to note
>> that reading for meter #2 and meter #3 overlap ...
> You can do
>   … OVER(PARTITION BY electric_meter_pk ORDER BY reading_date)
> to split you data by meter.
>


That looks like it works great! Much simpler-looking SQL than what I was
working on.

Thanks!


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Create extension tablefunc fails with "wrong ELF class: ELFCLASS32"
Next
From: Jan Mechtel
Date:
Subject: Create extension tablefunc fails with "wrong ELF class: ELFCLASS32"