Function
Returns a number that represents the sound of a string.
Grammar
SOUNDEX ( string-expression )
Parameters
The string-expression string.
Usage
The value of the SOUNDEX function of a string is based on the first letter and the next three consonants except H, Y, and W. Two repeating letters are counted as one letter. For example
SOUNDEX (' apples ')
Based on the letters A, P, L, and S.
The SOUNDEX function ignores multibyte characters.
Although not perfect, SOUNDEX usually returns the same number for words that sound similar and begin with the same letter.
The SOUNDEX function works best for English words. For other languages, it is of little use.
Standards and compatibility
sql/92 supplier extension.
sql/99 supplier extension.
Sybase is compatible with Adaptive Server Enterprise, but Adaptive server Enterprise returns a CHAR (4) result, and Adaptive server Anywhere return Returns an integer.
Example
The following statement returns two numbers that represent the sound of each name. The SOUNDEX value for each parameter is 3827.
SELECT SOUNDEX (' Smith '), SOUNDEX (' Smythe ')
difference function [string] Function
Returns the difference between the SOUNDEX values of two string expressions.
Grammar
difference ( string-expression-1, string-expression-2 )
Parameters
string-expression-1 the first SOUNDEX parameter.
string-expression-2 a second SOUNDEX parameter.
Standards and compatibility
sql/92 supplier extension.
sql/99 supplier extension.
Sybase is compatible with Adaptive Server Enterprise.
See Also
- SOUNDEX function [string]
Example
The following statement returns the value 3.
SELECT difference (' Test ', ' chest ')
Soundex and Defference functions use