954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Case & Decode

Can anyone tell me what is the difference between case and decode. and which one is more
beneficial

rohanvispute
Newbie Poster
1 post since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

CASE executes faster.

DECODE works with expressions which are scalar values.

CASE can work with predicates and subqueries in searchable form:

CASE handles NULL values differently

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

Decode MUST be in a Select statement and will not work using directly as PL/SQL.

A Case statement can be used directly in PL/SQL.

Note: Case is an old statement that was dropped,
BUT was brought back, so check your versions of DB.

hfx642
Posting Pro
515 posts since Nov 2009
Reputation Points: 248
Solved Threads: 105
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You