SQL-soundex function

SELECT SOUNDEX ('Smith'), SOUNDEX ('Smythe'); ----- ----- S530 S530 (1 row(s) affected) 

Here, the value returned by the SOUNDEX () function is "S530".

Please tell us how the input expression is processed in the SOUNDEX () function. In this example, the first character is "S" because its first character is in the input expression, but how are the remaining three digits calculated?

+6
source share
1 answer

Check out this article

The first letter of the code corresponds to the first letter of the name. The rest of the code consists of three numbers obtained from the syllables of the word in accordance with the following code:

  • 1 = B, F, P, V
  • 2 = C, G, J, K, Q, S, X, Z
  • 3 = D, T
  • 4 = L
  • 5 = M, N
  • 6 = R

Double letters with the same code Soundex, A, E, I, O, U, H, W, Y, and some prefixes are ignored ...

So, for Smith and Smith, the code is created as follows:

 SS -> S mm -> 5 iy -> 0 tt -> 3 hh -> 0 e -> - 
+9
source

Source: https://habr.com/ru/post/896567/


All Articles