Searching for Nulls and Nonnulls in the Same Search Condition - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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, use the following SELECT statement:

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