Table countries contains a list of country codes and corresponding country name.
I am attempting to add an additional column to the geonames allCountries table. The new column is defined as country_name varchar(60).
Example,
US = United States of America
Currently I have a list of all the country codes and their corresponding country name. I am attempting to insert the country_name into the appropriate tuple within the Geonames table, any help would be appreciated.
A desired result would look like the following,
SELECT DISTINCT country_code, country_name
FROM geonames
US = United States of America
ZA = South Africa
RO = Romania
.....
I attempted the following but it is majorly flawed
UPDATE geoname
SET country_name =
(SELECT country_name
FROM countries)
WHERE country_code =
(SELECT country_code
FROM countries)