DECODE and CASE.

Published on by LakshmiSaahul,Dhana Royal

Differ 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.

Advertising
To be informed of the latest articles, subscribe:
Comment on this post