Lists & arrays
Scalar
reduce()
Reduces all elements of the input list into a single scalar value by executing the lambda function on a running result and the next list element. The lambda function has an optional initial_value argument.
Reference: DuckDB 2.0.0
Alias of list_reduce()
Arguments & returns
2 overloadsreduce(list, lambda)
Scalar
| Overload link | list | lambda |
Returns |
|---|---|---|---|
| #01 | ANY[] | LAMBDA |
ANY |
reduce(list, lambda, initial_value)
Scalar
| Overload link | list | lambda | initial_value |
Returns |
|---|---|---|---|---|
| #02 | ANY[] | LAMBDA | ANY |
ANY |
Example
Haybarn WASM 2.0.0-rc12 · In your browser
Engine example · Run to view results.