Reference Guide > TDV Support for SQL Functions > Character Functions > LE_DST
 
LE_DST
The return value indicates how different the two input strings are calculated according to the Levenshtein edit distance algorithm. A value of 0 indicates that the strings are equivalent without any modifications. The algorithm computes the number of modifications that are required to change the first string into the second string. The strings are case-sensitive. A modification is a change such as an addition, deletion, letter case-change, or substitution of a single character.
Syntax
le_dst (<str_expr_1>, <str_expr_2>)
Example
SELECT le_dst('sow','show')
The above query returns a value of 1 (the addition of the character h)
 
SELECT le_dst('hello','Hollow')
The above query returns a value of 3
(the substitution of e for o, the capitalization of H, and the addition of w).
Remarks
Because the string comparisons are case-sensitive, you can use functions such as upper() and lower() to change the letter casing of strings before the comparison and ignore case-change modifications. For example, select le_dst('Smith','SMYTH') returns a value of 4 (three uppercase letter changes and a letter substitution). The function select le_dst(upper('Smith'),'SMYTH') returns a value of 1 (the I/Y letter substitution).