更新两科成绩,每科条件都是小于95分成绩提高5分,100分封顶
参考下这个:
学生表S(S_ID,S_Name),课程表B(B_ID,B_Name),成绩表C(S_ID,B_ID,C_Score),现需要将成绩表中选了课程名称为a的学生成绩低于60的同学的成绩乘以1.1。
with a as(
select S_ID,C_Score from C,B where C.B_ID = B.B_ID and B.B_Name = 'a')
update a set C_Score = C_Score*1.1 where C_Score<60
update 表名 set 科目1 = 分数1 , 科目2 = 分数2 where 科目1>95 and 科目2>95
UPDATE table SET a = a+5 WHERE a <=95;
UPDATE table SET b = b+5 WHERE b <=95;
update C set C_Score=(C_Score*1.1)
where C_Score <60
and B_ID= (select B_ID from B where B_Name='a')
update result set score = if((score+5)>100,100,(score+5)) where (project = '语文' or project = '数学') and score < 95
按你字面意思理解得出来的