Re: Question about WITH ORDINALITY and unnest

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Question about WITH ORDINALITY and unnest
Дата
Msg-id CAKFQuwZpWf8SKrqLB3e4CFuLNinRM2-Ouy-xT84CTyO55CkeHA@mail.gmail.com
обсуждение исходный текст
Ответ на Question about WITH ORDINALITY and unnest  (Mike Martin <redtux1@gmail.com>)
Ответы Re: Question about WITH ORDINALITY and unnest
Список pgsql-sql
On Saturday, January 23, 2021, Mike Martin <redtux1@gmail.com> wrote:

Is there any way to make the ordinality ordering to be over the entire record set rather than per array

No
 

(the idea is to combine two arrays of varying dimensions into one, keeping order)

I have got a working solution by adding a rowid and ordering the array by eg: rowid+nr (where rowid is 100,200, big enough not to be in record set)

Yep, this is what I often do as well.

David J.
 

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

Предыдущее
От: Mike Martin
Дата:
Сообщение: Question about WITH ORDINALITY and unnest
Следующее
От: Shaozhong SHI
Дата:
Сообщение: Re: Question about WITH ORDINALITY and unnest