首页 > 代码库 > 更新teaching中fdSubjectID为null的老数据

更新teaching中fdSubjectID为null的老数据

UPDATE wkwke.tbTeachingV3 teaching SET teaching.fdSubjectID = (
                    SELECT fdValue FROM
                    (SELECT teaching1.id, subtype.fdValue
                            FROM wkwke.tbTeachingV3 teaching1
                            LEFT JOIN wkctn.tbContent content
                            ON teaching1.fdPrepareID=content.id
                            LEFT JOIN wkctn.tbInteger subtype
                            ON subtype.fdContentID = content.id
                            WHERE subtype.fdAttributeID = 36
                    ) newSubject WHERE  newSubject.id = teaching.id
        )

更新teaching中fdSubjectID为null的老数据