SOUNDEX
SOUNDEX(string)

Returns a string of digits representing phonetic pronunciation of the input string. The following steps are used to derive the output string:

  1. The first letter of the string is retained.

  2. All occurrences of the following letters are removed: a, e, h, i, o, u, w, and y.

  3. Any remaining letters are replaced with digits as shown in Table 5-2.

  4. The resulting string is truncated to four characters in length.

Using SOUNDEX can make it easier to search for a given string, because you don't need to spell it in exactly the correct way to get a match.

Table 5-2. SOUNDEX Letter-to-Digit Correspondence
Letters SOUNDEX Digit
b, f, p, v 1
c, g, j, k, q, s, x, z 2
d, t 3
l 4
m, n 5
r 6

Example

SQL> SELECT SOUNDEX('O''Reilly'), SOUNDEX('ORiley'), SOUNDEX('OH Riley')
  2  FROM dual;

SOUN SOUN SOUN
---- ---- ----
O640 O640 O640

Get Oracle SQL: the Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.