Re: UNNEST ... WITH ORDINALITY (AND POSSIBLY OTHER STUFF)
| От | Alvaro Herrera |
|---|---|
| Тема | Re: UNNEST ... WITH ORDINALITY (AND POSSIBLY OTHER STUFF) |
| Дата | |
| Msg-id | 1290194728-sup-123@alvh.no-ip.org обсуждение исходный текст |
| Ответ на | Re: UNNEST ... WITH ORDINALITY (AND POSSIBLY OTHER STUFF) (<Caleb.Welton@emc.com>) |
| Список | pgsql-hackers |
Excerpts from Caleb.Welton's message of vie nov 19 15:48:06 -0300 2010: > Note the standard also supports unnesting multiple arrays concurrently, the rule for handling arrays with different lengthsis to use null padding of the shorter array. > > SELECT * FROM > UNNEST( ARRAY[5,2,3,4], > ARRAY['hello', 'world'] ) > WITH ORDINALITY AS t(a,b,i); > > a b i > --- ---------- ------ > 5 'hello' 1 > 2 'world' 2 > 3 3 > 4 4 > (4 rows) Hmm, this is pretty interesting and useful --- I had to deal with some XPath code not long ago and I had to turn to plpgsql; I think it could have been done with multi-array unnest. -- Álvaro Herrera <alvherre@commandprompt.com> The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support
В списке pgsql-hackers по дате отправления: