# SOUNDEX

> SOUNDEX function in StackQL: the four-character Soundex code of a string, for matching names that sound alike.

Source: https://stackql.io/language-spec/functions/string/soundex

Returns the four-character Soundex code of a string, so that names that sound alike in English, such as `Robert` and `Rupert`, can be matched.

See also:  
[[` SELECT `]](/language-spec/select) [[` LOWER `]](/language-spec/functions/string/lower)

* * * 

## Syntax

```sql
SELECT SOUNDEX(string) FROM <multipartIdentifier>;
```

## Arguments

__*string*__  
A string.

## Return Value(s)
Returns a four-character string, a letter followed by three digits.  The result is `?000` for `NULL` or for a string with no ASCII letters.

* * *

## Examples

### Compare names by sound

`Robert` and `Rupert` share a code:

```sql
SELECT SOUNDEX('Robert') AS a, SOUNDEX('Rupert') AS b, SOUNDEX('Tymczak') AS c;
```

```
|------|------|------|
|  a   |  b   |  c   |
|------|------|------|
| R163 | R163 | T522 |
|------|------|------|
```

For more information, see [https://www.sqlite.org/lang_corefunc.html#soundex](https://www.sqlite.org/lang_corefunc.html#soundex)
