The DIFFERENCE() function is to compare the similarity of Soundex values from 2 data values in 4 integer value scales. Soundex is a phonetic (sound) coding system intended to compare spelling variations.
Syntax:
SELECT DIFFERENCE(Value1, Value1);
This is very useful during the import/export process or data maintenance. Often we find it difficult to compare data with queries or joins because of typos or differences in the spelling of names. The DIFFERENCE() function helps us to compare the sound similarity between 2 data on a scale of 0 to 4. The bigger the number the more similar.
Let's see how it works:
SELECT DIFFERENCE('dara', 'jelantah') AS Resemblance_Scale UNION ALL
SELECT DIFFERENCE('keterangan', 'ketenangan') AS Resemblance_Scale UNION ALL
SELECT DIFFERENCE('pikterangan','pikacu') AS Resemblance_Scale UNION ALL
SELECT DIFFERENCE('Juice', 'Jus') AS Resemblance_Scale
SELECT DIFFERENCE('dara', 'jelantah') AS Resemblance_Scale UNION ALL
SELECT DIFFERENCE('keterangan', 'ketenangan') AS Resemblance_Scale UNION ALL
SELECT DIFFERENCE('pikterangan','pikacu') AS Resemblance_Scale UNION ALL
SELECT DIFFERENCE('Juice', 'Jus') AS Resemblance_Scale
Result:
0 Comments