1.>=
case
when score>=80 then ‘优秀’
when score<80 and score>=60 then ‘良好’
else ‘不及格’
end as comment
select
case
when score>=80 then '优秀'
when score<80 and score>=60 then '良好'
else '不及格'
end as comment
from (select 80 as score) t
2.=
case score
when 80 then ‘优秀’
when 60 then ‘良好’
else ‘不及格’
end as comment
或者
case
when score=80 then ‘优秀’
when score=60 then ‘良好’
else ‘不及格’
end as comment
select
case score
when 80 then '优秀'
when 60 then '良好'
else '不及格'
end as comment
from (select 80 as score) t