Re: How can I calculate differences between values

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: How can I calculate differences between values
Дата
Msg-id 396486430911100656r179ac488y8b8330bf54a2e10e@mail.gmail.com
обсуждение исходный текст
Ответ на How can I calculate differences between values  (A B <gentosaker@gmail.com>)
Список pgsql-general
On Tue, Nov 10, 2009 at 6:40 AM, A B <gentosaker@gmail.com> wrote:

> For example
> if the table contains:
>
> 4, 100
> 5, 200
> 5, 210
> 5, 231
>
>
> I want the values
>
> 5,10
> 5,21

> I guess that will work, but I'm curious, are there other ways?

I think this kind of operation is best suited for CTEs and Windowing.
I just wish I was more experienced with it to give more specific
advice.  However, here are the doc that might start you on the right
path:
http://www.postgresql.org/docs/8.4/interactive/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS
http://www.postgresql.org/docs/8.4/interactive/sql-select.html

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Incremental Backups in postgres
Следующее
От: Vyacheslav Kalinin
Дата:
Сообщение: Re: How can I calculate differences between values