Re: Question about WITH ORDINALITY and unnest - Mailing list pgsql-sql

From Tom Lane
Subject Re: Question about WITH ORDINALITY and unnest
Date
Msg-id 1382518.1611438610@sss.pgh.pa.us
Whole thread Raw
In response to Re: Question about WITH ORDINALITY and unnest  (Shaozhong SHI <shishaozhong@gmail.com>)
List 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 by date:

Previous
From: Shaozhong SHI
Date:
Subject: Re: Question about WITH ORDINALITY and unnest
Next
From: ml@ft-c.de
Date:
Subject: format integer