Name
soundex, difference — phonetic string encoding and similarity
Synopsis
varchar soundex(
|
in str varchar); |
integer difference(
|
in str1 varchar, |
in str2 varchar); |
Description
soundex returns the 4-character Soundex code of
str. The code consists of the leading letter of the
input followed by three digits encoding consonant groups; vowels and
similar-sounding consonants are collapsed so that words that sound alike
share the same Soundex code.
difference compares the Soundex codes of two strings
and returns an integer between 0 and 4 indicating their similarity. A
value of 4 means identical Soundex codes; 0 means the strings have nothing
in common.
Examples
Example 24.208. Simple Examples
SQL> select soundex ('Robert'), soundex ('Rupert');
SQL> select difference ('Robert', 'Rupert');