Files
CNCEC_SUBQHSE_WUHUAN/DataBase/版本日志/已更新脚本/2022年度/SGGLDB_V2022-06-14-001.sql
T

7 lines
397 B
Transact-SQL
Raw Normal View History

2022-07-17 09:15:38 +08:00
--修复试卷统计与成绩不符
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