Skip to main content
Concatenates input values, including NULL values, into an array.

Syntax

Parameters

Return Type

ARRAY of the same type as the input data. If there is no input data, ARRAY_AGG returns NULL.

Example

The following examples use a player_information table:

Rows: 3Execution time: 5ms

The following example aggregates the columns into arrays, including NULL values:

Rows: 1Execution time: 10.40ms

The following example shows that when a WHERE filter rejects all rows, ARRAY_AGG returns NULL:

Rows: 1Execution time: 8.85ms