Returns the difference between two soundex values.
difference(expr1,expr2)
select difference("smithers", "smothers")
--------- 4
select difference("smothers", "brothers")
--------- 2
difference, a string function, returns an integer representing the difference between two soundex values.
The difference function compares two strings and evaluates the similarity between them, returning a value from 0 to 4. The best match is 4.
The string values must be composed of a contiguous sequence of valid single- or double-byte roman letters.
If expr1 or expr2 is NULL, returns NULL.
If you give a varchar expression is given as one parameter and a unichar expression as the other, the varchar expression is implicitly converted to unichar (with possible truncation).
See also Transact-SQL Users Guide.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute difference.