select SNO from (select SNO, sum(case subject when'语文' then score else null end) as chinese_score, sum(case subject when'数学' then score else null end) as math_score from t group by SNO ) as tt where tt.chinese_score>=60 and tt.math_score<60 ===================================== 如果是case subject ……else 0的话结果就会多了一个1002

相关推荐

11-07 21:45
已编辑
福建省建阳第一中学 golang
点赞 评论 收藏
分享
牛客网
牛客企业服务