SQL解码语句 [英] SQL Decode statement
本文介绍了SQL解码语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用SQL Decode语句对(D.code,2,'Resident',else,'Business')描述进行解码,有没有办法识别解码语句中的所有其他内容?
I am trying to use a SQL Decode statement to Decode (D.code ,2,'Resident',else,'Business') Description, Is there a way to identify everything else in a decode statement?
推荐答案
是的,有:
decode ( <condition>, <test expr #1>, <result #1>, ..., <test expr #n>, <result #n>, <fallback result>);
但是,在标准sql中,您将使用
however, in standard sql you would use
case <condition>
when <test expr #1> then <result #1>
...
when <test expr #n> then <result #n>
else <fallback result>
end
这篇关于SQL解码语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文