SOUNDEX

functionsupportedCore SQL functions

docs.snowflake.com ↗

String & binary functions

Returns a string that contains a phonetic representation of the input string. You can use this function to determine whether two strings (e.g. the family names Levine and Lavine, the words to and too, etc.) have similar pronunciations in the English language. This function uses the Soundex phonetic algorithm, which is described in Soundex System. Note, however, that Snowflake provides no special handling for surname prefixes (e.g. “Van”, “De”, “La”, etc.). SOUNDEX('Pfister') returns P236. Because the first two letters (P and f) are adjacent and share the same Soundex code number (1), the function ignores the Soundex code number for the second letter. Some database systems (e.g. Teradata) use a variant that retains the Soundex code number for the second letter when the first and second letters use the same number. For that variant, the string for Pfister is P123 (not P236). To use that variant, call the SOUNDEX_P123 function instead.

Syntax

SOUNDEX( <varchar_expr> )

Parameters

NameRequiredDescription
varchar_exprrequiredThe string for which a representation of the pronunciation is returned. The string should use the Latin or Unicode character set.

Returns

The returned value is a VARCHAR that contains the phonetic representation of the input string. In other words, the return value is a string (not a sound) that represents the pronunciation (not the spelling) of the input string. Note the following: - The returned value starts with a letter that represents the first letter in the string followed by 3 digits (e.g. s400, c130). For more information about how the return value is calculated, see the Soundex phonetic algorithm (in Wikipedia). - As mentioned earlier, if you want to use the variant that retains the Soundex code number for the second letter when the first and second letters use the same number, call the SOUNDEX_P123 function instead.

Usage notes

See also

Referenced by