Use of SOUNDEX() Function in Oracle
You use SOUNDEX(x) to get a string containing the phonetic representation of x. This lets you
compare words that sound alike in English but are spelled differently.
The following query retrieves the last_name column from the customers table where
last_name sounds like “whyte”:
(Pronouncing in same way but spelling different )
SELECT last_name
FROM customers
WHERE SOUNDEX(last_name) = SOUNDEX('whyte');
LAST_NAME
----------
White
The next query gets last names that sound like “bloo”:
SELECT last_name
FROM customers
WHERE SOUNDEX(last_name) = SOUNDEX('bloo');
LAST_NAME
----------
Blue
compare words that sound alike in English but are spelled differently.
The following query retrieves the last_name column from the customers table where
last_name sounds like “whyte”:
(Pronouncing in same way but spelling different )
SELECT last_name
FROM customers
WHERE SOUNDEX(last_name) = SOUNDEX('whyte');
LAST_NAME
----------
White
The next query gets last names that sound like “bloo”:
SELECT last_name
FROM customers
WHERE SOUNDEX(last_name) = SOUNDEX('bloo');
LAST_NAME
----------
Blue
Comments
Post a Comment