Skip to content

Compares the pronunciation of two strings by their Soundex codes. Soundex is a phonetic algorithm that produces a code representing the pronunciation of a string, allowing for approximate matching of strings based on their pronunciation rather than their spelling. PlaidCloud Lakehouse offers the SOUNDEX function that allows you to get the Soundex code from a string.

SOUNDS LIKE is frequently employed in the WHERE clause of SQL queries to narrow down rows using fuzzy string matching, such as for names and addresses, see Filtering Rows in Examples.

func.sounds_like(<str1>, <str2>)
func..sounds_like('Monday', 'Sunday')
┌───────────────────────────────────────┐
│ func..sounds_like('Monday', 'Sunday') │
├───────────────────────────────────────┤
0
└───────────────────────────────────────┘
<str1> SOUNDS LIKE <str2>
ArgumentsDescription
str1, 2The strings you compare.

Return a Boolean value of 1 if the Soundex codes for the two strings are the same (which means they sound alike) and 0 otherwise.

SELECT 'two' SOUNDS LIKE 'too'
----
1
SELECT CONCAT('A', 'B') SOUNDS LIKE 'AB';
----
1
SELECT 'Monday' SOUNDS LIKE 'Sunday';
----
0
SELECT * FROM employees;
id|first_name|last_name|age|
--+----------+---------+---+
0|John |Smith | 35|
0|Mark |Smythe | 28|
0|Johann |Schmidt | 51|
0|Eric |Doe | 30|
0|Sue |Johnson | 45|
SELECT * FROM employees
WHERE first_name SOUNDS LIKE 'John';
id|first_name|last_name|age|
--+----------+---------+---+
0|John |Smith | 35|
0|Johann |Schmidt | 51|