SELECT emp_id, emp_name,
CASE sex
WHEN 'M' THEN 'Male'
WHEN 'F' THEN 'Female'
ELSE 'Problem'
END
FROM emp
The CASE actually has two forms. The first is called Simple case. It's the form that I used above. The second is called Searched case. Check the BOL for more info.
>emp_id emp_name sex
>------ -------- ---
>001 John M
>002 Susie F
>003 David M
>004 Dummy null
>
>Using decode
>
>Select emp_id , emp_name , DECODE(sex,'M','Male','F','Female','Male') SEX
>From emp
>
-Mike