16.20 - Example - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1145-162K
Language
English (United States)

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.