SOUNDEX(str)
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 non-alphabetic characters in str
are ignored. All international alphabetic characters outside the A-Z range are treated as vowels.
Important: When using SOUNDEX(), you should be aware of the following limitations:
SOUNDEX('Hello'); +------------------+ | SOUNDEX('Hello') | +------------------+ | H400 | +------------------+
SELECT SOUNDEX('MariaDB'); +--------------------+ | SOUNDEX('MariaDB') | +--------------------+ | M631 | +--------------------+
SELECT SOUNDEX('Knowledgebase'); +--------------------------+ | SOUNDEX('Knowledgebase') | +--------------------------+ | K543212 | +--------------------------+
SELECT givenname, surname FROM users WHERE SOUNDEX(givenname) = SOUNDEX("robert"); +-----------+---------+ | givenname | surname | +-----------+---------+ | Roberto | Castro | +-----------+---------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/soundex/