PL/SQL Decode

Oracle PL/SQL Decode Function

The Decode function is equivalent with an IF-THEN-ELSE statement.

The Decode Function syntax:

decode( expression , search , result [, search , result]… [, default] )

Example:

SELECT 
name, 
decode(id, 100, 'JSP', 101, 'ASP', 102, 'PHP', 'Java') 
FROM languages;

Select decode('aaa','aaa','ok','bbb','nok') From dual;
ok