MySQL Update Query from another table


sencoding

/* query to update  a table from another table */
UPDATE classes a, temp_classes_import b
SET a.timeloctxt = b.timeloctxt,
a.tutors = b.tutors
WHERE a.idclasses = b.idclasses;

 

/* same thing but with fully specified join */
UPDATE classes a
JOIN temp_classes_import b
SET a.timeloctxt = b.timeloctxt,
a.tutors = b.tutors
WHERE a.idclasses = b.idclasses;

View original post