Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the proper structure for searching within MySQL using SOUNDEX()?
Basically, SOUNDEX() function is used to return the Soundex, a phonetic algorithm for indexing names after English pronunciation of sound, a string of a string. The proper structure for searching within MySQL using SOUNDEX() is as follows −
SOUNDEX(Str)
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)
The result of SOUNDEX(‘harshit’) and SOUNDEX(‘hrst’) is same because the sound of both the words is same.
Advertisements