UPDATE `Table2` JOIN `Table1` ON `Table1`.`a_id` = `Table2`.`id` SET `Table2`.`txn_stamp` = `Table1`.`tranx_id`