Documentation, window functions

Поиск
Список
Период
Сортировка
От Dennis Björklund
Тема Documentation, window functions
Дата
Msg-id e2ba8fee01f49aab7a6b67be1fde2424.squirrel@zigo.org
обсуждение исходный текст
Ответы Re: Documentation, window functions  (Robert Haas <robertmhaas@gmail.com>)
Re: Documentation, window functions  (Hitoshi Harada <umi.tanuki@gmail.com>)
Список pgsql-hackers
In
http://www.postgresql.org/docs/9.0/static/tutorial-window.html

it say

"Although avg will produce the same result no matter what order it
processes the partition's rows in, this is not true of all window
functions. When needed, you can control that order using ORDER BY within
OVER."

While it's true that avg() produce the same result no matter what order. A
ORDER BY clause will affect what rows are included in the computation and
thus change the result (the default window frame is
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW). So one can not in
general add an ORDER BY to the example in the tutorial and get the same
result as without an ORDER BY.

Maybe we can find some better wording of the above?

/Dennis




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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Get the offset of a tuple inside a table
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Compute the number of tuples in a block