Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between CASE and DECODE

EV259Jun 2 2013 — edited Jun 3 2013
Hi All,

Could you please explain me the basic differences between the CASE and DECODE, which performs fast...?

DECODE is Oracle one, and the CASE is ANSI standard.

As per my knowledge, CASE is a statement and DECODE is a function which was defined in the Standard package.

If we use DECODE, the package has to load first, so it will take a little longer than the CASE. CASE is a simple statement which is ANSI standard.

We can use the CASE in the where clause and can not use the DECODE in the where clause.

Please clarify me and correct me if anything wrong.

Thanks,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 1 2013
Added on Jun 2 2013
12 comments
34,679 views