list_filter()

Constructs a list from those elements of the input list for which the lambda function returns true

Reference: DuckDB 1.3.2

Arguments & returns

list_filter(list, lambda)

Scalar
Overload link listlambda Returns
#01 ANY[]LAMBDA ANY[]

Example

list_filter example
SQL
Haybarn WASM 2.0.0-rc12 · In your browser

Engine example · Run to view results.

Catalog examples

SELECT
  list_filter([3, 4, 5], x -> x > 4);

In other engines

Snowflakearray_remove()

ARRAY_REMOVE([1, 2, 3], 2)
In DuckDB
LIST_FILTER([1, 2, 3], _u -> _u <> 2)

SQLGlot example ↗