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

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Searching for Nulls and Nonnulls In the Same Search Condition

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;