SQL DIFFERENCE Function

DIFFERENCE returns the SOUNDEX difference between two strings.

SOUNDEX refers to how a string sounds when spoken in English.

The returned values range from 0 (no similarity) to 4 (identical sounding).

Example

#

This example returns the SOUNDEX difference between two words.

SELECT DIFFERENCE('Read', 'Red') AS Difference
Result:  1 record
Difference
4

Note: A 4 indicates that the words sound similar or identical.

Syntax

Syntax of the DIFFERENCE function.

DIFFERENCE(string1, string2)

More Examples

DIFFERENCE with very different words

Problem: Measure the SOUNDEX difference between two very different strings.
SELECT DIFFERENCE('Query', 'Language') AS Difference
Result:  1 record
Difference
0

You may also like



Guides


vsn 3.1