• 更新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
            )

    update wkwke.tbTeachingV3 teaching left join wkctn.tbContent prepares on prepares.id = teaching.fdPrepareID left join wkctn.tbInteger subject on subject.fdAttributeID = 36 and subject.fdContentID =
    prepares.id set teaching.fdSubjectID = subject.fdValue
     
    更新班测记录
    UPDATE wkwke.tbScanExam scan LEFT JOIN wkwke.tbExam exam ON exam.id = scan.fdExamID LEFT JOIN wkctn.tbContent content ON content.id = exam.fdContentID LEFT JOIN wkctn.tbInteger subject ON subject.fdAttributeID = 36 AND subject.fdContentID = content.id SET scan.fdSubjectID = subject.fdValue 
     
    更新没有属性的学科年级组长
    UPDATE `tbPositionUserMap` usermap
    LEFT JOIN `tbPositionUserAttributeMap` attribute ON
    usermap.id = attribute.fdPositionUserMapID
    SET usermap.fdStatus = 1
    WHERE usermap.fdPositionID IN ( 4, 5 )
    AND usermap.fdStatus =0
    AND attribute.id IS NULL
     
  • 相关阅读:
    [POJ 1269]Intersecting Lines
    [POJ 3304]Segments
    [HNOI 2011]数学作业
    [UOJ 12]猜数
    [UOJ 282]长度测量鸡
    [HAOI 2007]理想的正方形
    [POJ 2318]TOYS
    [SDOI 2009]HH的项链
    [USACO 12DEC]Running Away From the Barn
    [HDU 2036]改革春风吹满地
  • 原文地址:https://www.cnblogs.com/huixuexidezhu/p/5980263.html
Copyright © 2020-2023  润新知