16.10 - Searching for Nulls and Nonnulls In the Same Search Condition - Teradata Database

Teradata Database Design

Product
Teradata Database
Release Number
16.10
Release Date
June 2017
Content Type
User Guide
Publication ID
B035-1094-161K
Language
English (United States)

To search for nulls and non-nulls within the same predicate, the search condition for nulls must be specified separately from any other search conditions.

For example, to select the names of all employees with the job title of ‘Vice Pres,’ ‘Manager,’ or null, you could type the following SELECT statement:

     SELECT name, job_title
     FROM employee
     WHERE job_title IN (’Manager’ OR ’Vice Pres’)
     OR    job_title IS NULL;