MySQL SOUNDS LIKE Function

MySQL SOUNDS LIKE is one of the String Function, which is useful to compare the Soundex codes of a given two string expressions. The basic syntax of the SOUNDS LIKE Function 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 in MySQL.

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';
MySQL SOUNDS LIKE Function 1

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 String 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);
MySQL SOUNDS LIKE Function 2