UPDATE activity_base_info bINNER JOIN activity_question q on b.question_group_id=q.group_id set q.activity_id=b.id;