Right of the bat, I'm going to say that I believe that this is what I want:
Update multiple rows using select statement. The answer seems to be for what I want to do.
My tables ares as follows. tPatientsIDs contains only two columns: keyid and uid.
tEyeResults contains a column named patientid and a column named puid. The values of patientid match the column uid from tPatientsIDs and puid is empty, having been created by altering the table recently.
All I want to do is set the value puid to the keyid in tPatientIDs that corresponds to the value of the column patientid.
Here is the query I'm using based on the answer on SO:
UPDATE tEyeResults SET puid = tPatientIDs.keyid FROM tPatientIDs WHERE
tPatientIDs.uid = tEyeResults.patientid;
Even though the structure seems Identical to the answer I get the error:
You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'FROM
tPatientIDs
WHERE tPatientIDs.uid = tEyeResults.patientid' at line 1