Home >Database >Mysql Tutorial >What is the correct structure for searching in MySQL using SOUNDEX()?
Basically, the SOUNDEX() function is used to return Soundex, a phonetic algorithm used to index names, strings of strings, after the English pronunciation of sounds . The correct structure for searching in MySQL using SOUNDEX() is as follows -
SOUNDEX(Str)
Here, Str is the string whose SOUNDEX string is to be retrieved.
mysql> Select SOUNDEX('MySQL'); +------------------+ | SOUNDEX('MySQL') | +------------------+ | M240 | +------------------+ 1 row in set (0.00 sec) mysql> Select SOUNDEX('harshit'); +--------------------+ | SOUNDEX('harshit') | +--------------------+ | H623 | +--------------------+ 1 row in set (0.00 sec) mysql> Select SOUNDEX('hrst'); +-----------------+ | SOUNDEX('hrst') | +-----------------+ | H623 | +-----------------+ 1 row in set (0.00 sec)
SOUNDEX(‘harshit’) and SOUNDEX(‘hrst’) have the same result because both words have the same pronunciation.
The above is the detailed content of What is the correct structure for searching in MySQL using SOUNDEX()?. For more information, please follow other related articles on the PHP Chinese website!