Aggregates
Aggregate
list()
Returns a LIST containing all the values of a column.
Arguments & returns
list(arg)
Aggregate
| Overload link | arg |
Returns |
|---|---|---|
| #01 | ANY |
LIST |
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example with sample data · Run to view results.
In other engines
Used in larger rewrites 2
These examples use list as one part of a larger SQL translation.
Apache Sparkcollect_set()
SELECT COLLECT_SET(sample_col) FROM sample_table
SELECT LIST(DISTINCT sample_col) FILTER(WHERE NOT sample_col IS NULL) FROM sample_table
Snowflakearray_unique_agg()
SELECT ARRAY_UNIQUE_AGG(col) FROM t
SELECT LIST(DISTINCT col) FILTER(WHERE NOT col IS NULL) FROM t