I have two tables like this:
Summary Table
ID int
CityName Varchar(200)
PopulationCount int
Data Table
ID int
CityName Varchar(200)
PopulationCount int
Longitude float
Latitude float
The summary table has 800 rows and the DataTable has 800,000 rows. Each CityName in the Summary Table is in the Data Table at least once (and quite often multiple times). I need to create a new table to hold each of the 800 cities from the summary table and their corresponding Latitudes/Longitudes from the Data Table.
The problem is the CityName field in the summary table isn't an exact match to the CityName in the Data Table. There are slight differences.
Sample Data:
Summary Table, CityName: Yarmouth (N.S.)
Data Table, CityName: Yarmouth
The pattern in the sample data above doesn't always hold true i.e. the difference is not always a bracket so I dont see regex etc working. I imagine a contains() or like '% CityName %' could possibly work but I don't know how to implement them correctly.
Any help would be greatly appreciated...