Re: Sorted group by

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: Sorted group by
Дата
Msg-id AANLkTikaYYY0xftv=1nqPQZWbqiqyOgaSLz69cV_OcMo@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sorted group by  (Matthew Wakeling <matthew@flymine.org>)
Ответы Re: Sorted group by  (Thom Brown <thom@linux.com>)
Список pgsql-performance
On 10 August 2010 17:03, Matthew Wakeling <matthew@flymine.org> wrote:
> On Tue, 10 Aug 2010, Thomas Kellerer wrote:
>>
>> No. It's built in (8.4) and it's called Windowing functions:
>> http://www.postgresql.org/docs/8.4/static/tutorial-window.html
>> http://www.postgresql.org/docs/8.4/static/functions-window.html
>>
>> SELECT group, last_value(value) over(ORDER BY number)
>> FROM table
>
> I may be mistaken, but as I understand it, a windowing function doesn't
> reduce the number of rows in the results?
>

I think you are mistaken.  The last_value function is a window
function aggregate.  Give it a try.

--
Thom Brown
Registered Linux user: #516935

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

Предыдущее
От: Matthew Wakeling
Дата:
Сообщение: Re: Sorted group by
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Sorted group by