0

I am trying to compare 2 strings in a sql statement. Some of the string are almost identical and some are very different

For example:

The following 2 addresses are almost identical

22224 143RD AVE 
222-24 143RD AVE.

While the next 2 are very different

6969 elmund street 
6969 mamerth street

Is there a function to classify the degree of difference?

Lieven Keersmaekers
  • 57,207
  • 13
  • 112
  • 146
Internet Engineer
  • 2,514
  • 8
  • 41
  • 54
  • 1
    One way of measuring similarity is called Levenshtein distance. There's a good q & a here: http://stackoverflow.com/questions/560709/levenshtein-distance-in-t-sql – Andrew Feb 09 '12 at 19:37

1 Answers1

2

http://support.microsoft.com/kb/100365 lays out DIFFERENCE() and SOUNDEX(). I'm not sure how well these would work in your particular use case.

Chris Shain
  • 50,833
  • 6
  • 93
  • 125