list_slice()

list_slice with added step feature.

Arguments & returns

2 overloads

list_slice(list, begin, end)

Scalar

Extract a sublist using slice conventions. Negative values are accepted.

Overload link listbeginend Returns
#01 ANYANYANY ANY

list_slice(list, begin, end, step)

Scalar
Overload link listbeginendstep Returns
#02 ANYANYANYBIGINT ANY

Example

1 more ↓
list_slice example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

More examples

list_slice example 2
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

Catalog examples

SELECT
  array_slice('DuckDB', 3, 4);
SELECT
  array_slice('DuckDB', 3, NULL);
SELECT
  array_slice('DuckDB', 0, -3);