I have two tables, both have the same columns. We will call them tilistings and tilistings_temp
Two columns in tilistings_temp, lat and lng are geocoded with Google API. tilistings has these same two columns, but they are empty. tilistings may contain some rows that are not in tilistings_temp, and vise versa.
Every night, tilistings is imported from a 3rd party I do not want to have to geocode the existing 2500 coordinates that are in tilistings_temp so my question is how do I compare the two tables and:
Set the values of lat and lng in tilistings to the corresponding values from tilistings_temp (both tables have mlsid in common)
Is it:
UPDATE tilistings
SET lat = tilistings_temp.lat, lng = tilistings_temp.lng
WHERE mlsid = tilistings_temp.mlsid;
??? Sorry for asking if this is right, I just can not risk corrupting the data inside the database.
An update join might be quicker and its certainly less ugly than a double sub-query.