try with the CASE which is similar to DECODE with additional feature.

Here is the example:


select deptno,comm,(case when (deptno=10 or comm is null ) then 'test case' else 'test' end) from emp order by 2,1;


here the o/p will be

deptno comm case
10 test case
20 test case
10 800 test case
20 300 test

hope u got the point.