Categories:

Aggregate functions (Counting Distinct Values) , Window functions (Semi-structured Data Aggregation)

ARRAY_UNIQUE_AGG

Returns an ARRAY that contains all of the distinct values from the specified column.

See also:

Using Arrays to Compute Distinct Values for Hierarchical Aggregations

Syntax

ARRAY_UNIQUE_AGG( <column> )
Copy

Arguments

column

The column containing the values.

Returns

The function returns an ARRAY containing the distinct values in the specified column. The values in the ARRAY are in no particular order, and the order is not deterministic.

The function ignores NULL values in column. If column contains only NULL values or the table containing column is empty, the function returns an empty ARRAY.

Usage notes

  • This function can be used as either of the following types of functions:

  • When this function is called as a window function, it does not support explicit window frames.

Examples

Aggregation

See Using Arrays to Compute Distinct Values for Hierarchical Aggregations.

Language: English