1、更新院校国家代码(部标代码)
UPDATE pre_college_teacher SET pre_college_teacher.yxdm = (SELECT yxmc2yxdm_2.yxdm FROM yxmc2yxdm_2 WHERE 1 AND yxmc2yxdm_2.yxmc = pre_college_teacher.yxmc ) WHERE 1 AND pre_college_teacher.yxdm IS NULL
UPDATE pre_college_teacher SET pre_college_teacher.yxdm = (SELECT pre_college_yxmc2yxdm.yxdm FROM pre_college_yxmc2yxdm WHERE 1 AND pre_college_yxmc2yxdm.yxmc = pre_college_teacher.yxmc ) WHERE 1 AND pre_college_teacher.yxdm IS NULL
UPDATE pre_college_teacher_tw
SET pre_college_teacher_tw.yxdm =
(SELECT pre_college_school_tw.yxdm FROM pre_college_school_tw WHERE 1 AND pre_college_school_tw.yxmc = pre_college_teacher_tw.yxmc) WHERE 1 AND pre_college_teacher_tw.yxdm = ''
2、更新本科专业代码
UPDATE pre_college_school_major_intro
SET pre_college_school_major_intro.zydm =
(SELECT pre_chsi_zy_bk.zydm FROM pre_chsi_zy_bk WHERE 1 AND pre_chsi_zy_bk.zymc = pre_college_school_major_intro.zymc) WHERE 1 AND pre_college_school_major_intro.zycc = 1
继续阅读自己常用的更新某些字段的SQL语句