Re: nth_value and row_number in a partition
"David G. Johnston" <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.sql |
|---|---|
| Message-ID | <CAKFQuwa3SCRhpnjOK0=dNxL=vt2Lvrs9VYLhJ8p2UZrUqieShQ@mail.gmail.com> |
On Thursday, January 25, 2018, Olivier Leprêtre <[email protected]> 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.