*!* 测试数据
*!* CREATE CURSOR CJB(学号 C(10),总分 N(5,2),总分1 N(5,2))
*!* INSERT INTO CJB(学号,总分,总分1) VALUES('202011',561,0)
*!* INSERT INTO CJB(学号,总分,总分1) VALUES('202011',625,0)
*!* INSERT INTO CJB(学号,总分,总分1) VALUES('202012',711,0)
*!* INSERT INTO CJB(学号,总分,总分1) VALUES('202012',686,0)
UPDATE T1 SET T1.总分1=T2.总分1 FROM CJB AS T1,(SELECT 学号,SUM(总分) AS 总分1 FROM CJB GROUP BY 学号) AS T2 WHERE T1.学号=T2.学号
图片附件: 游客没有浏览图片的权限,请
登录 或
注册