Skip to content

DIFFERENCE

  • string1: The first string to compare.
  • string2: The second string to compare.
SELECT DIFFERENCE('test', 'tost')
2

The DIFFERENCE function returns an integer that represents the difference between the SOUNDEX values of two strings. In the example, the difference between ‘test’ and ‘tost’ is 2, indicating a moderate match according to the SOUNDEX system. This function is useful for comparing the similarity of words based on their phonetic sounds.