Instruire
Modul
Use built-in functions and GROUP BY in Transact-SQL - Training
Use built-in functions and GROUP BY in Transact-SQL
Acest browser nu mai este acceptat.
Faceți upgrade la Microsoft Edge pentru a profita de cele mai noi funcții, actualizări de securitate și asistență tehnică.
collect_list
aggregate functionApplies to: Databricks SQL
Databricks Runtime
Returns an array consisting of all values in expr
within the group. This function is a synonym for array_agg
aggregate function.
collect_list ( [ALL | DISTINCT] expr ) [FILTER ( WHERE cond ) ]
This function can also be invoked as a window function using the OVER
clause.
expr
: An expression of any type.cond
: An optional boolean expression filtering the rows used for aggregation.An ARRAY of the argument type.
The order of elements in the array is non-deterministic.
NULL
values are excluded.
If DISTINCT
is specified, the function collects only unique values and is a synonym for collect_set
aggregate function.
> SELECT collect_list(col) FROM VALUES (1), (2), (NULL), (1) AS tab(col);
[1,2,1]
> SELECT collect_list(DISTINCT col) FROM VALUES (1), (2), (NULL), (1) AS tab(col);
[1,2]
Instruire
Modul
Use built-in functions and GROUP BY in Transact-SQL - Training
Use built-in functions and GROUP BY in Transact-SQL
Documentație
explode table-valued generator function - Azure Databricks - Databricks SQL
Learn the syntax of the explode function of the SQL language in Databricks SQL and Databricks Runtime.
array function - Azure Databricks - Databricks SQL
Learn the syntax of the array function of the SQL language in Databricks SQL and Databricks Runtime.
collect_set aggregate function - Azure Databricks - Databricks SQL
Learn the syntax of the collect\_set function of the SQL language in Databricks SQL and Databricks Runtime.