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

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务