UPDATE submission_files sf, notes_tmp n SET sf.assoc_type = 520, sf.assoc_id = n.note_id WHERE n.file_id = sf.file_id AND sf.file_stage = 3 UPDATE submission_files sf, notes_tmp n SET sf.assoc_type = 520, sf.assoc_id = n.note_id WHERE n.file_id = sf.file_id AND sf.file_stage = 3 UPDATE submission_files SET assoc_type = 520, assoc_id = n.note_id FROM notes_tmp n WHERE n.file_id = submission_files.file_id AND submission_files.file_stage = 3