What is the correct structure for searching in MySQL using SOUNDEX()?

王林
Release: 2023-09-07 10:13:13
forward
1084 people have browsed it

使用 SOUNDEX() 在 MySQL 中搜索的正确结构是什么?

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)
Copy after login

Here, Str is the string whose SOUNDEX string is to be retrieved.

Example

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!