levenshtein()

The minimum number of single-character edits (insertions, deletions or substitutions) required to change one string to the other. Characters of different cases (e.g., a and A) are considered different.

Reference: DuckDB 2.0.0

Arguments & returns

levenshtein(s1, s2)

Scalar
Overload link s1s2 Returns
#01 VARCHARVARCHAR BIGINT

Example

levenshtein example
SQL
Haybarn WASM 2.0.0-rc12 Β· In your browser

Engine example Β· Run to view results.

In other engines

BigQueryedit_distance()

EDIT_DISTANCE(a, b)
In DuckDB
LEVENSHTEIN(a, b)

SQLGlot example β†—

Exasoledit_distance()

EDIT_DISTANCE(col1, col2)
In DuckDB
LEVENSHTEIN(col1, col2)

SQLGlot example β†—

Snowflakeeditdistance()

EDITDISTANCE(col1, col2)
In DuckDB
LEVENSHTEIN(col1, col2)

SQLGlot example β†—