Skip to contents
  • array_extract(list = `T[]`, index = BIGINT): Extracts the indexth (1-based) value from the list.

  • array_extract(string = VARCHAR, index = BIGINT): Extracts a single character from a string using a (1-based) index.

  • array_extract(struct = STRUCT, entry = VARCHAR): Extracts the named entry from the STRUCT.

  • array_extract(struct = STRUCT, index = BIGINT): Extracts the entry from an unnamed STRUCT (tuple) using an index (1-based).

Usage

array_extract(list, index)

Arguments

list

T[]

index

BIGINT

Value

T | VARCHAR | ANY

Overloads

  • array_extract(list = `T[]`, index = BIGINT)

  • array_extract(string = VARCHAR, index = BIGINT)

  • array_extract(struct = STRUCT, entry = VARCHAR)

  • array_extract(struct = STRUCT, index = BIGINT)

SQL examples

array_extract('DuckDB', 2)
array_extract({'i': 3, 'v2': 3, 'v3': 0}, 'i')
array_extract(row(42, 84), 1)
array_extract([4, 5, 6], 3)