案例与解码 [英] CASE vs. DECODE
问题描述
参考先前的问题,我想知道是否可以始终用 CASE 替换 DECODE ,并且哪个性能更好?
Referring to a previous question, i was wondering if its always possible to replace DECODE by CASE and which one is better for performance?
推荐答案
与Oracle一样…… AskTom ...
As always with Oracle ... AskTom...
通过此帖子 ...
解码有点模糊-CASE是 非常非常清楚是的东西 易于解码 案例,困难的或接近的事情 解码不可能,很容易 在情况下要做.从逻辑上讲,CASE必胜 放手.
Decode is somewhat obscure -- CASE is very very clear. Things that are easy to do in decode are easy to do in CASE, things that are hard or near impossible to do with decode are easy to do in CASE. CASE, logic wise, wins hands down.
从性能的角度看,它们几乎是相同的,上面的文章再次提到了一些速度差异,但是如果没有基准测试特定的语句,就很难说了.
From a performance point of view seems they are about the same, again above article mentions some speed differences but without benchmarking the particular statements it's hard to say.
这篇关于案例与解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!