SOUNDEX()

All functions > STRING > SOUNDEX()

Returns a four-character Soundex code representing the phonetic sound of a string.

Signatures

Returns: Four-character Soundex code representing the phonetic sound

SOUNDEX(string: VARCHAR) → VARCHAR
sql
ParameterTypeRequiredDescription
stringVARCHARYesString to convert to Soundex code

Notes

  • Used for fuzzy string matching based on pronunciation
  • Words that sound similar have the same Soundex code
  • Result is always a letter followed by three digits
  • Useful for matching names despite spelling variations

Examples

FeatureQL
SELECT
    f1 := SOUNDEX('Smith'), -- Common surname
    f2 := SOUNDEX('Smythe'), -- Similar sound to Smith
    f3 := SOUNDEX('Johnson'), -- Another surname
    f4 := SOUNDEX('Jonson'), -- Similar to Johnson
    f5 := SOUNDEX('Williams'), -- Different pattern
    f6 := SOUNDEX('Robert') -- First name example
;
Result
f1 VARCHARf2 VARCHARf3 VARCHARf4 VARCHARf5 VARCHARf6 VARCHAR
S530S530J525J525W452R163

Last update at: 2026/05/26 17:22:09