Re: Lag and lead window functions order by weirdness

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: Lag and lead window functions order by weirdness
Дата
Msg-id m31vl0r6g5.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на Re: Lag and lead window functions order by weirdness  (Thom Brown <thombrown@gmail.com>)
Список pgsql-sql
Thom Brown <thombrown@gmail.com> wrote:

> [...]
> Having a look around, it looks as if Postgres might be misbehaving.
>  According to this page,
> http://my.safaribooksonline.com/0596004818/sqlnut2-CHP-4-SECT-3, the ORDER
> BY in the window function's clause shouldn't be having this ordering effect:

> "Furthermore, the order within these groups is defined by an ordering
> clause, but that order only affects function evaluation, and has no effect
> on the order in which rows are returned by the query."

> The behaviour is unexpected from my perspective, but obviously there are
> workarounds.  Is anyone able to confirm any of this?

AFAIR, others have already pointed out that without an "OR-
DER BY" clause PostgreSQL can return the result set in *any*
"order" it deems fit. So why don't you use one?

Tim



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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Efficiency in Multiple Queries of Same Table in a PL/PgSQL Function
Следующее
От: "Oliveiros C,"
Дата:
Сообщение: Re: How to order varchar data by word