Oracle – Decode Function
DECODE(value, search_value, result, default_value) compares value with search_value. If the values are equal, DECODE() returns result, otherwise default_value is returned. DECODE() allows you to perform if-then-else logic in SQL without having to use PL/SQL.
Example 1
Example 2
Refer for more detail
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions040.htm