作业帮 > 综合 > 作业

case when语句结尾用end 还是end case

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/04/27 22:31:18
case when语句结尾用end 还是end case
PL SQL
end 和 end case
有什么区别?
case when语句结尾用end 还是end case
你是想用case when 语句来用某些字来替换查询结果中的一些数据吧.用的是end
举个例子:
select 学号,姓名,等级=
case
when 总学分 is null then '尚未选课'
when 总学分 < 60 then '不及格'
when 总学分 >= 50 and 总学分< 70 then '合格'
else '优秀'
end
from Student