Advanced Functions
Function Usage Example Result
NVL Allows you to substitute a value when
a NULL value is encountered.
Example 1: NVL(SUPPLIER_CITY,
‘Please Complete’)
If Supplier City is populated this will
return the city name, if NULL it will
return ‘Please Complete’.
NVL2 Extends the functionality found in the
NVL function. Substitute a value when
NULL is encountered as well as when a
non-NULL value is encountered.
Example 1: NVL2(SUPPLIER_CITY,
‘Completed’, ‘Please Complete’)
If Supplier City is populated this will
return ‘Completed’, if NULL it will
return ‘Please Complete’.
ROWNUM Assigns a number indicating the order
in which each row is returned by a
query.
ROWNUM 2931
ROWNUM Limits the number of rows returned in
a result set.
ROWNUM < 10 Returns 9 rows of results.
CASE Performs the functionality of an “IF-
THEN-ELSE” statement
CASE
WHEN condition_1 THEN result_1
WHEN condition_2 THEN result_2
ELSE result
END
CASE
WHEN A.ACAD_CAREER = 'UGRD'
THEN 'Undergraduate Student'
WHEN A.ACAD_CAREER = 'GRAD'
THEN 'Graduate Student'
ELSE 'Check Career'
END
Undergraduate Student