Google News
logo
PL/SQL - Interview Questions
Difference between DECODE and CASE.
DECODE and CASE statements are very similar, but CASE is extended version of DECODE. DECODE does not allow Decision making statements in its place.
 
select decode(totalsal=12000,’high’,10000,’medium’) as decode_tesr from smp where smpno in (10,12,14,16);
 
This statement returns an error :
 
CASE is directly used in PL SQL, but DECODE is used in PL/SQL through SQL only.
Advertisement