Looking to enhance my code in R using an RODBC connection to WinSQL to retrieve fuzzy matches.
The query to retrieve exact matches works perfectly, i.e. 'John Doe' and 'Jane Doe' are successfully matched from the uploaded list to the main table.
list_of_names: "'John Doe', 'Jane Doe'"
EXACT_MATCHES <- sqlQuery(con, paste("Select *
from MainTable
where NAME in (",list_of_names,")"))
I'd like to retrieve partial/fuzzy matches e.g. "Jane R. Doe-Wang".
fuzzy_names: "'John.* Doe .* ', 'Jane.* Doe .*'"
I've used % as well as .* and substituted LIKE with IN. No luck.
FUZZY_MATCHES <- sqlQuery(con, paste("Select *
from MainTable
where NAME in (",fuzzy_names,")"))