NVL2


The NVL2 has appeared in the 9i documentation, but interestingly you can get this function in virtually any 8.x version of Oracle. NVL2 is an extension of NVL, being

NVL2(a,b,c) = if 'a' is not null then return 'b' else return 'c'

and you'll probably find its available in your current release...
SQL> select nvl2(1,2,3) from dual;

NVL2(1,2,3)
-----------
          2

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle8 Enterprise Edition Release 8.0.6.2.0 - Production
PL/SQL Release 8.0.6.2.0 - Production
CORE Version 4.0.6.0.0 - Production
TNS for Solaris: Version 8.0.6.2.0 - Production
NLSRTL Version 3.3.3.0.0 - Production