Re: obtain the difference between successive rows

Поиск
Список
Период
Сортировка
От Berend Tober
Тема Re: obtain the difference between successive rows
Дата
Msg-id 508310EC.8070207@computer.org
обсуждение исходный текст
Ответ на Re: obtain the difference between successive rows  (Виктор Егоров <vyegorov@gmail.com>)
Список 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 по дате отправления: