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.

Alias of list_reduce()

Arguments & returns

2 overloads

reduce(list, lambda(x,y))

Scalar
Overload link listlambda(x,y) Returns
#01 ANY[]LAMBDA ANY

reduce(list, lambda(x,y), initial_value)

Scalar
Overload link listlambda(x,y)initial_value Returns
#02 ANY[]LAMBDAANY ANY

Example

reduce example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.