my mysql table has a cityname column. the values in the cityname column has some spelling mistakes. each of the spelling mistakes of city needs to be corrected. another table has a column that contains all correct city names. based on this table the spelling mistakes of the first table are needed to be corrected. i researched over stuff like soundex but couldn't find any link which has done something similar.
TableA
+----+------------+----------+
| id | col1 | city_name |
+----+------------+----------+
TableB
+----+------------+--
| index |City_name |
+----+------------+--
The approach i am having in the mind is that getting a sql query that creates seperate table out of the rows which have similar sounding city names.
once this is done replacing wrong spellings with correct ones again using an sql query
and finally combining all different tables into one table with all corrected spellings.
i am looking for advice both in approach as well as mysql query syntax