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

Last update at: 2026/06/20 10:08:10