从表列结果显示sql自定义文本 [英] display sql custom text from table column result
本文介绍了从表列结果显示sql自定义文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
让我说select score from table1
.这将返回结果
score
----
0
20
40
如何使用案例,将输出更改为0->完全不同意20->同意40->非常同意
how to use case, to change the output to if 0->strongly not agree 20->agree 40->very agreed
推荐答案
我认为这就是您想要的:
I think thats what you want:
select
case
when score >= 40 then 'very agreed'
when score >= 20 then 'agree'
else 'strongly not agree'
end
from table1
这篇关于从表列结果显示sql自定义文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文