Documentation

    list_extract

    Get the list item at a position, where 1 is the first item. A negative position counts from the end.

    Also available as list_element.

    Try an expression

    In Formula, enter the expression and set Output type to INTEGER.

    Expression

    list_extract([4, 5, 6], 3)

    Result

    6

    To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    list_extract(list, index)
    list
    List, Text
    index
    Number
    Supported signatures (2)
    list_extract(list: T[], index: BIGINT) → T
    list_extract(list: VARCHAR, index: BIGINT) → VARCHAR

    The result type can depend on the input types. See DuckDB for the full argument rules.

    Things to know

    Positions start at 1. A negative position counts from the end.

    If the first argument is missing, the result is NULL.

    Count from the end

    list_extract([4, 5, 6], -1)

    6

    Browse lists & arraysDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.