--修复试卷统计与成绩不符 UPDATE Training_TestRecord SET Training_TestRecord.TestScores =item.SCore from (SELECT SUM(SubjectScore) AS SCore,TestRecordId FROM Training_TestRecordItem GROUP BY TestRecordId) item where Training_TestRecord.TestRecordId=item.TestRecordId AND Training_TestRecord.TestEndTime IS NOT NULL AND item.SCore != Training_TestRecord.TestScores AND item.SCore IS NOT NULL GO