w3resource

PostgreSQL UNNEST() function

UNNEST() function

This function is used to expand an array to a set of rows.

Syntax:

unnest(anyarray)

Return Type:

setof anyelement

PostgreSQL Version: 9.3

Example: PostgreSQL UNNEST() function

Code:

SELECT unnest(ARRAY[1,2]);

Sample Output:

 unnest
--------
      1
      2
(2 rows)

Previous: STRING_TO_ARRAY function
Next: Introduction to JOIN



Follow us on Facebook and Twitter for latest update.




We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook