sql语句中如何用case when 语句当满足条件时输出,否则不输出。分值不高,还请高手帮忙。 10
2个回答
展开全部
select * from dbo.score
select UID,成绩=case
when ExamScore<60 then 'E'
when ExamScore between 60 and 69 then 'D'
when ExamScore between 70 and 79 then 'C'
when ExamScore between 80 and 89 then 'B'
else 'A'
end
from dbo.score
和这个类似 适当修改即可
select UID,成绩=case
when ExamScore<60 then 'E'
when ExamScore between 60 and 69 then 'D'
when ExamScore between 70 and 79 then 'C'
when ExamScore between 80 and 89 then 'B'
else 'A'
end
from dbo.score
和这个类似 适当修改即可
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询