w3resource

Oracle SOUNDEX function

Description

The Oracle SOUNDEX function returns a character string containing the phonetic representation of char. This function lets you compare words that are spelled differently, but sound alike in English.

This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.

Syntax:

SOUNDEX(char)

Parameters:

Name Description Data Types
char A string whose SOUNDEX string is to be retrieved. CHAR, VARCHAR2, NCHAR, or NVARCHAR2

Return Value Type

CHAR, VARCHAR2, NCHAR, or NVARCHAR2

Applies to

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Examples: Oracle SOUNDEX function

The following example returns the employees whose last names are a phonetic representation of "Smyth":

SELECT last_name, first_name
FROM employees 
WHERE SOUNDEX(last_name) = SOUNDEX('SMYTHE') ORDER BY last_name, first_name;
 

Sample Output:

LAST_NAME  FIRST_NAME
---------- ----------
Smith      Lindsey
Smith      William

Previous: RTRIM
Next: SUBSTR



Share this Tutorial / Exercise on : Facebook and Twitter