Re: nth_value and row_number in a partition

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: nth_value and row_number in a partition
Дата
Msg-id CAKFQuwa3SCRhpnjOK0=dNxL=vt2Lvrs9VYLhJ8p2UZrUqieShQ@mail.gmail.com
обсуждение исходный текст
Ответ на nth_value and row_number in a partition  (Olivier Leprêtre <o.lepretre@gmail.com>)
Ответы RE: nth_value and row_number in a partition
Список pgsql-sql
On Thursday, January 25, 2018, Olivier Leprêtre <o.lepretre@gmail.com> wrote:

nth_value(integer, bigint) doesn't exists.  

This is close, you just need to cast to integer. 

(cast(row_number() as integer)  over (partition by roads,segments order by orders))) 

You cannot separate the window function from its over clause.

Cast( Row_number() over (...) as integer )

Not tested...and I tend to use :: instead of cast

David J.

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

Предыдущее
От: Olivier Leprêtre
Дата:
Сообщение: nth_value and row_number in a partition
Следующее
От: Olivier Leprêtre
Дата:
Сообщение: RE: nth_value and row_number in a partition