Felix18807
Programmer
I have two tables containing name and a postcode data.
I need to do fuzzy matching between the two. I can join the two tables on postcode but want to fuzzy match on the name string.
I have a code that generates a statistic of similarity between two strings and creates a greater value for a more similar match (Jaro).
This far I have been using this query
to identify the matches but on reflection I do not believe this gives me the best match for a postcode.
So I have made this query I hope selects the top fuzzy match
My problem starts when I try to use this query as a subquery in an update. Has anyone got any experience of this? One solution would be to create a table based on my query then use this for the update but I want to avoid this extra step as this process is repeated frequently.
Many Thanks
I need to do fuzzy matching between the two. I can join the two tables on postcode but want to fuzzy match on the name string.
I have a code that generates a statistic of similarity between two strings and creates a greater value for a more similar match (Jaro).
This far I have been using this query
Code:
UPDATE [TABLEB] INNER JOIN [TABLEA] ON [TABLEB].[Postcode] = [TABLEA].POSTCODE SET [TABLEA].B_ID = [TABLEB].ID, [TABLEA].MatchLevel = "3. Fuzzy Name And Postcode"
WHERE ((([TABLEA]. MatchLevel) Is Null) AND ((Jaro([TABLEA]![Name],[TABLEB]![Name]))>=0.8));
So I have made this query I hope selects the top fuzzy match
Code:
SELECT TableA.*, FUZZY.TableB.ID, FUZZY.Jaro
FROM (SELECT TableA.ID, TableB.ID, Max(Jaro([TableA].[Name],[TableB].[Name])) AS Jaro
FROM TableB INNER JOIN TableA ON TableB.Postcode = TableA.Postcode
GROUP BY TableA.ID, TableB.ID
HAVING (((Max(jaro([TableA].[Name],[TableB].[name])))>=0.8 And (Max(Jaro([TableA].[Name],[TableB].[Name])))<1))
) AS FUZZY INNER JOIN TableA ON FUZZY.TableA.ID = TableA.ID;
My problem starts when I try to use this query as a subquery in an update. Has anyone got any experience of this? One solution would be to create a table based on my query then use this for the update but I want to avoid this extra step as this process is repeated frequently.
Many Thanks