Sunday, February 12, 2012

What is the difference between case and decode in oracle?

Everything DECODE can do, CASE can. There is a lot more that you can do with CASE, though, which DECODE cannot – which we’ll see in this article.


1. CASE can work with logical operators other than ‘=’

2. CASE can work with predicates and searchable subqueries

3. CASE can work as a PL/SQL construct

4. Careful! CASE handles NULL differently

5. CASE expects datatype consistency, DECODE does not

No comments:

Post a Comment