update sc set score=score*1.05
where score<(select avg(score) from sc) and sno in (select sno from students where ssex='女');

请问这个哪里错了,成绩小于平均成绩
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- codeSniping 2022-05-13 19:31关注
SQLServer中可以支持这种写法,但是mySql不行的,不能直接把select出的结果集作为条件。
修改为:update sc set score=score*1.05 where score<(select score from(select avg(score)score from sc)a) and sno in (select sno from (select sno from students where ssex='女')b);
若有帮助,请采纳~
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报