Documentation

    damerau_levenshtein

    Count the edits needed to turn one string into another, like levenshtein, but swapping two neighboring characters counts as one edit. Uppercase and lowercase letters count as different.

    Try an expression

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

    Expression

    damerau_levenshtein('duckdb', 'udckbd')

    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

    damerau_levenshtein(s1, s2)
    s1
    Text
    s2
    Text
    Supported signatures (1)
    damerau_levenshtein(s1: VARCHAR, s2: VARCHAR) → BIGINT

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

    Things to know

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

    Browse textDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.