CASE vs. DECODE

前端 未结 7 1119
小蘑菇
小蘑菇 2020-11-28 09:04

Referring to a previous question, i was wondering if its always possible to replace DECODE by CASE and which one is better for performance?

相关标签:
7条回答
  • 2020-11-28 10:02

    CASE is a statement and DECODE is a function We can use the CASE in the where clause and can not use the DECODE in the where clause. DECODE can check equality operators only where as CASE can support all relational operators DECODE can be used in sql only where as CASE can be used in SQL AND PL/SQL CASE is better than DECODE.

    You can find more: http://www.oraclegeneration.com/2014/01/sql-query-interview-questions.html

    0 讨论(0)
提交回复
热议问题