nth_value out of more than n values returns null

Поиск
Список
Период
Сортировка
От Guyren Howe
Тема nth_value out of more than n values returns null
Дата
Msg-id 3ed0759d-c332-4f96-a147-499a694e9204@Spark
обсуждение исходный текст
Ответы Re: nth_value out of more than n values returns null
Re: nth_value out of more than n values returns null
Список pgsql-general
This query:

SELECT NTH_VALUE(id, 5000000) OVER (ORDER BY created_at, id ASC) FROM table

in a table where SELECT COUNT(*) returns a value a few thousand over 5 million, where id is the primary key, returns null.

The inclusion of the primary key should make the order by a total order. So there should be a 5 millionth row.

How can this happen?

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