2 回答

TA貢獻1803條經驗 獲得超3個贊
decode可以代替case when語句,在語句寫法上可以節省很多coding的時間
但是執行效率上其實與case when是差不多的
oracle特有這個函數的更多是為了方便使用,而不是效率考慮

TA貢獻1786條經驗 獲得超11個贊
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).
并沒有證據證明decode更快吧,查資料時倒是看到這么一句話case 方式“offer better performance as well”
額 剛發現你只是問decode··· 這個文檔的內容是說decode 和 case when的比較···
- 2 回答
- 0 關注
- 162 瀏覽
添加回答
舉報