forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
4.2 KiB
4.2 KiB
levenshtein
This function is used to returns the Levenshtein distance between two strings, for example, levenshtein('kitten','sitting') = 3.

Levenshtein distance is a type of edit distance. It indicates the minimum number of edit operations required to convert one string into another.
Syntax
levenshtein(string A, string B)
Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
A, B |
Yes |
STRING |
String to be entered for calculating the Levenshtein distance |
Return Values
The return value is of the INT type.
Example Code
The value 3 is returned.
SELECT levenshtein('kitten','sitting');
Parent topic: String Functions