Example

Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

The following query:

SELECT department_name, 
   NVL(last_name,'NO EMPLOYEE') "LAST NAME"
FROM employee E 
   FULL OUTER JOIN Department D
ON department_number=d.department_number;
WHERE department_number IN(402,600);

returns:

Department_name      LAST NAME
--------- --------------------
Software Support     Crane
New Department       NO EMPLOYEE

In this example, the NVL function returned the result as last_name column value from the employee table and for the cases where the last_name value is NULL, the function returned the result as NO EMPLOYEE.