SOUNDS LIKE
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Xpand
Topics on this page:
Overview
Soundex matching.
USAGE
word1 SOUNDS LIKE word2
Value Name | Description |
---|---|
| The two words to compare |
DETAILS
The SOUNDS LIKE
operator checks if the Soundex string version of two words match. A 1
(true) is returned if they match, otherwise a 0
(false) is returned.
A Soundex string will be the same for similar sounding words. As an example, the words "seas" and "sees" have the same Soundex value.
The SOUNDEX()
function can be used to determine the Soundex value for a particular word.
A NULL
is returned if either word
is NULL
.
EXAMPLES
SELECT 'Seas' SOUNDS LIKE 'sees';
+---------------------------+
| 'Seas' SOUNDS LIKE 'sees' |
+---------------------------+
| 1 |
+---------------------------+
SELECT 'Places' SOUNDS LIKE 'play says';
+----------------------------------+
| 'Places' SOUNDS LIKE 'play says' |
+----------------------------------+
| 1 |
+----------------------------------+
SELECT 'Foo' SOUNDS LIKE 'Phoo';
+--------------------------+
| 'Foo' SOUNDS LIKE 'Phoo' |
+--------------------------+
| 0 |
+--------------------------+
-- MDB matches this but xpand does not...
SELECT 'mariadb' SOUNDS LIKE 'M631';
+------------------------------+
| 'mariadb' SOUNDS LIKE 'M631' |
+------------------------------+
| 0 |
+------------------------------+