SQL
Reduce
**Signature:** `list_reduce(list, lambda)`  
**Description:**
The scalar function returns a single value
that is the result of applying the lambda function to each element of the input list.
Starting with the first element
and then repeatedly applying the lambda function to the result of the previous application and the next element of the list.
The list must have at least one element.  
**Aliases:**  
* `array_reduce`
* `reduce`  
**Number of parameters excluding indexes:** 2  
**Return type:** The type of the input list's elements  
#### Examples {#docs:sql:functions:lambda::examples}  
Sum of all list elements:  
```sql
SELECT list_reduce([1, 2, 3, 4], (x, y) -> x + y);
```  
```text
10
```  
Only add up list elements if they are greater than 2:  
```sql
SELECT list_reduce(list_filter([1, 2, 3, 4], x -> x > 2), (x, y) -> x + y);
```  
```text
7
```  
Concat all list elements:  
```sql
SELECT list_reduce(['DuckDB', 'is', 'awesome'], (x, y) -> concat(x, ' ', y));
```  
```text
DuckDB is awesome
```