Re: nth_value out of more than n values returns null

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: nth_value out of more than n values returns null
Дата
Msg-id CAKFQuwYPU+j46pHakraap1d4jYzPVMx00o95NMe0WLuamkJp+g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: nth_value out of more than n values returns null  (Guyren Howe <guyren@gmail.com>)
Список pgsql-general
On Monday, November 4, 2024, Guyren Howe <guyren@gmail.com> wrote:
Wouldn’t it be offset 4_999_999?

Probably.  I tend to expect off-by-one for these kinds of things and test my way out.
 

I’d still like to understand why nth_value doesn’t work.

When you perform an order by in a window clause the frame you get by default ends at the current row.  Consider “count(*) over ()” versus “count(*) over (order by id)”.

You need to not use defaults for the window frame if this doesn’t suit you.

David J.

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