Peter Blazsik
Peter Blazsik

Reputation: 77

fuzzy matching in sql

given two tables with client information. One is with sales data, other is an enrichment mapping. Field for client name is present in both tables, also is the country of residence and the city of residence. The latter two are clean data.

Unfortunately the client name is close, but sometimes with slight differences. (for example: Vienna University vs Vienna University of Technology).

My target is to join the tables, and enrich the sales table with the enrichment mapping table information.

Thus I would like to setup a fuzzy match in mssql, where the two column I want to use for the join not necessarily 100% matching. Technically I know that this topic could be covered in R with a fuzzy join package, but I would really prefer to keep it in mssql.

I would like to ask if there is a way to do so?

Upvotes: 3

Views: 5221

Answers (2)

Peter Smith
Peter Smith

Reputation: 5550

There is no simple answer to this and some algorithms are available which may need the development of a CLR function. There is a good discussion in this question and it's answers.

Upvotes: 0

BoCoKeith
BoCoKeith

Reputation: 946

There are MANY ways to do this. One approach that will probably get you close is the built-in SOUNDEX function. If that doesn't work, you might try something like: first four letters of last name + first two letters of second name.

Upvotes: 1

Related Questions