Re: Question about WITH ORDINALITY and unnest

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about WITH ORDINALITY and unnest
Дата
Msg-id 1382518.1611438610@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question about WITH ORDINALITY and unnest  (Shaozhong SHI <shishaozhong@gmail.com>)
Список pgsql-sql
Shaozhong SHI <shishaozhong@gmail.com> writes:
> Has anyone got a nice way to deal with unequal numbers of elements in
> arrays?

This might or might not be what you want, but:

db=# select * from unnest(ARRAY[1,2], ARRAY['foo','bar','baz']) as x(a,b);
 a |  b  
---+-----
 1 | foo
 2 | bar
   | baz
(3 rows)

            regards, tom lane



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

Предыдущее
От: Shaozhong SHI
Дата:
Сообщение: Re: Question about WITH ORDINALITY and unnest
Следующее
От: ml@ft-c.de
Дата:
Сообщение: format integer