w3resource
MySQL Tutorial

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



New Content: Composer: Dependency manager for PHP, R Programming