Documentation

    position

    Find where a search string first appears in text, counting from 1. Returns 0 if there is no match.

    Also available as instr, strpos.

    Try an expression

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

    Expression

    position('b' IN 'abc')

    Result

    2

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

    Arguments and types

    position(search IN string)
    string
    Text
    search_string
    Text

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

    Things to know

    Missing text

    position('b' IN NULL::VARCHAR)

    NULL

    Browse textDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.