I have two tables, one that stores the the id of the an old img
id | old_img_name | old_img_id and another table that stores the info of the current img
id |img_name | img_w | img_h | etc.... and im trying to create a query to update(switch) the info from the old table into the new one, the only field that I want to update is the img_name.
I have create two queries to do that :
SELECT id, old_img_id, old_img_name FROM `img_archives` WHERE id = 3 UPDATE imgs SET img_name = old_img_name WHERE id = old_img_id I want to convine these two queries into one, but I'm having a lot or problem doing it.
I have tried this:
UPDATE imgs SET img_name = img_archives_old_img_name FROM imgs INNER JOIN img_archives ON imgs_id = img_archives.old_img_id; not is not working