– 加字段
ALTER TABLE teach_bks_select_tutor ADD COLUMN DETAIL_ID VARCHAR(50) COMMENT ‘论文题目Id’;
ALTER TABLE teach_graduate_student ADD COLUMN DETAIL_ID VARCHAR(50) COMMENT ‘论文题目Id’;
– 给字段赋值(更行多条记录,注意判断地段为空要用IS NULL 不能用=NULL)
update teach_bks_select_tutor s set s.DETAIL_ID = (SELECT t1.DETAIL_ID FROM teach_bks_tutor_question_detail t1 where t1.LWTM = s.TM )
where 1=1 AND s.DETAIL_ID IS NULL;
update teach_graduate_student s set s.DETAIL_ID = (SELECT t1.DETAIL_ID FROM teach_bks_tutor_question_detail t1 where t1.LWTM = s.TM )
where 1=1 AND s.DETAIL_ID IS NULL;