Does SQL Server have an equivalent function to Postgres Similar to compare strings?
I looking for something that will match
str1 = "Flat 1, 110 Bob Street"
str2 = "110, Bob St. Flat 1"
so I can do
select
...
from
t1 join
t2 on (similar(t1.str1,t2.str2) >= 0.9)
Here are some implementations of string distance functions in TSQL that might help:
Levenshtein
Jaro-Winkler (Registration required)
SoundEx
MatchText
I have had a lot of luck with Jaro-Winkler, but of course that's due to the nature of my data. The one that closest resembles the similarity query that you asked about is MatchText.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With