-- How to update one table based on another table's values on the fly?
-- http://dba.stackexchange.com/questions/21152/how-to-update-one-table-based-on-another-tables-values-on-the-fly/36664
UPDATE ips
INNER JOIN country
ON ips.iso = country.iso
SET ips.countryid = country.countryid