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
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | String 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 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR | f5 VARCHAR | f6 VARCHAR |
|---|---|---|---|---|---|
| S530 | S530 | J525 | J525 | W452 | R163 |
On this page