Skip to main content

SOUNDEX

Returns a soundex string from str. Two strings that sound almost the same should have identical soundex strings. A standard soundex string is four characters long, but the SOUNDEX() function returns an arbitrarily long string. You can use SUBSTRING() on the result to get a standard soundex string. All nonalphabetic characters in str are ignored. All international alphabetic characters outside the A-Z range are treated as vowels.

Syntax​

SOUNDEX(str)

Arguments​

ArgumentsDescription
strThe string.

Return Type​

A string data type value or null.

Examples​

SELECT SOUNDEX('hello');
+-----------------------------------+
| `SOUNDEX('hello')` |
+-----------------------------------+
| H400 |
+-----------------------------------+

SELECT SOUNDEX('international');;
+---------------------------------------+
| `SOUNDEX('international')` |
+---------------------------------------+
| I5365354 |
+---------------------------------------+

SELECT SOUNDEX('ä½ quadratically');
+-------------------------------------+
| `SOUNDEX('ä½ quadratically')` |
+-------------------------------------+
| ä½ 236324 |
+-------------------------------------+

SELECT SOUNDEX(NULL);
+-------------------------------------+
| `SOUNDEX(NULL)` |
+-------------------------------------+
| <null> |
+-------------------------------------+