콘텐츠로 이동

두 문자열의 Soundex 코드로 발음을 비교합니다. Soundex는 문자열의 발음을 나타내는 코드를 생성하는 음성 알고리즘으로, 철자가 아닌 발음을 기준으로 문자열을 근사 일치시킬 수 있습니다. PlaidCloud Lakehouse는 문자열에서 Soundex 코드를 얻을 수 있는 SOUNDEX 함수를 제공합니다.

SOUNDS LIKE는 이름이나 주소처럼 퍼지 문자열 일치로 행을 좁히기 위해 SQL 쿼리의 WHERE 절에서 자주 사용됩니다. 예제의 행 필터링을 참조하십시오.

func.sounds_like(<str1>, <str2>)
func..sounds_like('Monday', 'Sunday')
┌───────────────────────────────────────┐
│ func..sounds_like('Monday', 'Sunday') │
├───────────────────────────────────────┤
│ 0 │
└───────────────────────────────────────┘
<str1> SOUNDS LIKE <str2>
인수 설명
str1, 2 비교할 문자열입니다.

두 문자열의 Soundex 코드가 같으면(즉, 발음이 비슷하면) Boolean 값 1을, 그렇지 않으면 0을 반환합니다.

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|