I have a table "City" which contains city names, and I have a another table which I just created and contains cities from different sources. When I run a query to match the cities between the two tables I find about 5000 mismatches.
So please give some queries which I can use to match cities (because sometimes users enter city names with one or two character different)... I have created a query which is working fine but I need such a query to match more.
Please suggest me what to do in such a situation.
SELECT distinct hsm.countryname,co.countryname,hsm.city,co.city
FROM HotelSourceMap AS hsm
INNER JOIN
( SELECT c.*,cu.countryName
FROM city c
INNER JOIN country cu ON c.countryid= cu.countryId
) co
ON (charindex(co.city,hsm.city) > 0 AND hsm.countryid = co.countryid) AND
hsm.cityid is null