I have two tables in two databases. Database 1 which is named db1 which has table addresses. Database 2 which is name db2 which has table counties.
The structure is as follows:
addresses:
_id | address | countyID | cityID | stateID | postalCode | countryID
counties:
_id | stateID | countyName
Currently the countyID in the addresses table has the county name. What I need to do is take the value that is in addresses.countyID find it in counties and select the countyID from the counties table and then update the addresses table with the countyID.
End result, the addresses.countyID needs to have the countyID not the countyName.
Thank you, any help would be great. I have been trying all kind of things. I tried simple WHERE and JOIN but nothing seems to be working. I am using MySQL as my database.
I just ended up creating a new table from the select results.
This was a bit easier to create this temp table than altering real data. This way I could run my SELECT command and test my results before applying them.