Catégories :

Fonctions d’agrégation (Counting Distinct Values) , Window functions (Semi-structured Data Aggregation)

ARRAY_UNIQUE_AGG

Renvoie un ARRAY qui contient toutes les valeurs distinctes de la colonne spécifiée.

Voir aussi :

Utilisation de tableaux pour calculer des valeurs distinctes pour les agrégations hiérarchiques

Syntaxe

Aggregate function

ARRAY_UNIQUE_AGG( <column> )
Copy

Window function

ARRAY_UNIQUE_AGG( <column> ) OVER ( [ PARTITION BY <expr> ] )
Copy

For details about the OVER clause, see Syntaxe et utilisation des fonctions de fenêtre.

Arguments

column

La colonne contenant les valeurs.

Renvoie

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.

Notes sur l’utilisation

  • Cette fonction peut être utilisée comme l’un des types de fonctions suivants :

  • Lorsque cette fonction est appelée en tant que fonction de fenêtre, elle ne prend pas en charge les cadres de fenêtres explicites.

  • Cette fonction ne prend pas en charge un type structuré comme argument d’entrée.

Exemples

Agrégation

Voir Utilisation de tableaux pour calculer des valeurs distinctes pour les agrégations hiérarchiques.