条件:
1、>=90:优秀
2、>=80:良好
3、>=60:及格
4、<60:不及格
执行:
select id as 学号, name as 姓名, score as 分数,
(
case
when score >= 90 then '优秀'
when score >= 80 and score < 90 then '良好'
when score >= 60 and score < 80 then '及格'
when score < 60 then '不及格'
end
)
as 等级
from scores;
网友评论