I have Persons
table in SQL Server 2008.
My goal is to find Persons who have almost similar addresses.
The address is described with columns state
, town
, street
, house
, apartment
, postcode
and phone
.
Due to some specific differences in some states (not US) and human factor (mistakes in addresses etc.), address is not filled in the same pattern.
Most common mistakes in addresses
- Case sensitivity
- Someone wrote "apt.", another one "apartment" or "ap." (although addresses aren't written in English)
- Spaces, dots, commas
- Differences in writing street names, like 'Dr. Jones str." or "Doctor Jones street" or "D. Jon. st." or "Dr Jones st" etc.
The main problem is that data isn't in the same pattern, so it's really difficult to find similar addresses.
Is there any algorithm for this kind of issue?
Thanks in advance.
UPDATE
- As I mentioned address is separated into different columns. Should I generate a string concatenating columns or do your steps for each column? I assume I shouldn't concatenate columns, but if I'll compare columns separately how should I organize it? Should I find similarities for each column an union them or intersect or anything else?
- Should I have some statistics collecting or some kind of educating algorithm?