MySQL SOUNDS LIKE is one of the String Function, which is useful to compare the Soundex codes of a given two string expressions.
MySQL SOUNDS LIKE Syntax
The basic syntax of the SOUNDS LIKE Function in MySQL is as shown below:
SELECT 'String_Expression1' SOUNDS LIKE 'String_Expression2'
This is same as the SOUNDEX(‘String_Expression1’) = SOUNDEX(‘String_Expression2’). I suggest you refer to the SOUNDEX function article.
MySQL SOUNDS LIKE Function Example
The Sounds Like Function compares the Soundex code of two string values and returns the output. The following query shows multiple ways to use this Sounds Like function.
SELECT 'Hi' SOUNDS LIKE 'Hi';
SELECT 'Hi' SOUNDS LIKE 'Hello';
SELECT 'MySQL' SOUNDS LIKE 'MySQ';
Let me show you another example of SOUNDS LIKE for better understanding. The first two statements are showing that the SOUNDS LIKE and SOUNDEX comparison returns the same. Within the last statement, we used a NULL value. Remember, the SOUNDS LIKE function returns NULL for NULL argument value.
SELECT 'Hi' SOUNDS LIKE 'Hi', SOUNDEX('Hi') = SOUNDEX('Hi');
SELECT 'Hello' SOUNDS LIKE 'Hi', SOUNDEX('Hello') = SOUNDEX('Hi');
SELECT NULL SOUNDS LIKE NULL, SOUNDEX(NULL) = SOUNDEX(NULL);