Re: Why can't I use windowing functions over ordered aggregates?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Why can't I use windowing functions over ordered aggregates?
Дата
Msg-id 51C48964.1050100@agliodbs.com
обсуждение исходный текст
Ответ на Why can't I use windowing functions over ordered aggregates?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Cedric,

> See this example:
> # create table foo (i int, t timestamptz);
> # insert into foo select n, now() from generate_series(1,10) g(n);
> # select i, first_value(i) over (order by t desc) from foo;
> # select i, first_value(i) over (order by t desc ROWS between 0 PRECEDING and 
> UNBOUNDED FOLLOWING) from foo;
> 
> What do you expect "SELECT first(val order by ts desc)" to output ?
> 

Ah, right, I see what you mean.  Yeah, I was doing queries without peer
rows, so it looked the same to me, and it uses some of the same
machinery.  But of course it's not completely the same.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



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

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: Why can't I use windowing functions over ordered aggregates?
Следующее
От: David Fetter
Дата:
Сообщение: Review [was Re: MD5 aggregate]