SOUNDEX

Returns a string that contains a phonetic representation of the input string.

Syntax

SOUNDEX(expression varchar) β†’ varchar

  • expression: The expression for which a representation of the pronunciation is returned.

Examples

SOUNDEX example
SELECT SOUNDEX('Smith'), SOUNDEX('Smythe')
-- EXPR$0, EXPR$1
-- S530, S530
SOUNDEX example
SELECT SOUNDEX('the data lake'), SOUNDEX('the data lakehouse'), SOUNDEX('the data warehouse')
-- EXPR$0, EXPR$1, EXPR$2
-- T334, T334, T336

Usage Notes

You can use this function to determine whether two strings (for example, similar last names β€˜Smith’ and β€˜Smythe’) have similar pronounciations in the English language. This function uses the Soundex phonetic algorithm, which is described in Soundex System. This function returns only four characters (one letter and three digits). As a result, the output is primarily determined by the first few syllables of the input, rather than the entire string.

Last updated