Is there a simple "Fuzzy" LIKE query to match similar strings? [message #589663] |
Tue, 09 July 2013 09:47 |
bws93222
Messages: 27 Registered: April 2009
|
Junior Member |
|
|
Hello. I'm looking for a simple query that does a "fuzzy" LIKE between two street addresses.
So, for example, if I had two STREET_ADDRESS values of '123 N. Elm St." and
'123 North Elm Street', I would want them to be matched. It doesn't need to be
perfect. If it just parses out the integers and compares those, that would be
fine. See my simplified pseudo-code below for what I'm trying to do. Any suggestions?
select MYTABLE.STREET_ADDRESS, OTHERTABLE.STREET_ADDRESS from MYTABLE, OTHERTABLE
where MYTABLE.STREET_ADDRESS LIKE OTHERTABLE.STREET_ADDRESS
|
|
|
|
Re: Is there a simple "Fuzzy" LIKE query to match similar strings? [message #589668 is a reply to message #589666] |
Tue, 09 July 2013 11:58 |
bws93222
Messages: 27 Registered: April 2009
|
Junior Member |
|
|
Thx. I really just needed something very quick and simple so I went ahead used this
which is imperfect but good enough to get (most of) the job done:
select MYTABLE.STREET_ADDRESS, OTHERTABLE.STREET_ADDRESS from MYTABLE, OTHERTABLE
where(instr(upper(MYTABLE.STREET_ADDRESS), upper(substr(OTHERTABLE.STREET_ADDRESS, 0, 3)))=1)
|
|
|
|