2 回答

TA貢獻(xiàn)1803條經(jīng)驗(yàn) 獲得超3個(gè)贊
decode可以代替case when語句,在語句寫法上可以節(jié)省很多coding的時(shí)間
但是執(zhí)行效率上其實(shí)與case when是差不多的
oracle特有這個(gè)函數(shù)的更多是為了方便使用,而不是效率考慮

TA貢獻(xiàn)1786條經(jīng)驗(yàn) 獲得超11個(gè)贊
Oracle now supports simple and searched CASE statements. CASE statements are similar in purpose to the DECODE statement, but they offer more flexibility and logical power. They are also easier to read than traditional DECODE statements, and offer better performance as well. They are commonly used when breaking categories into buckets like age (for example, 20-29, 30-39, and so on).
并沒有證據(jù)證明decode更快吧,查資料時(shí)倒是看到這么一句話case 方式“offer better performance as well”
額 剛發(fā)現(xiàn)你只是問decode··· 這個(gè)文檔的內(nèi)容是說decode 和 case when的比較···
- 2 回答
- 0 關(guān)注
- 161 瀏覽
添加回答
舉報(bào)