UPDATE TABLE2 JOIN TABLE1 ON TABLE2.SERIAL_ID = TABLE1.SUBST_ID SET TABLE2.BRANCH_ID = TABLE1.CREATED_ID;