IN/NOT IN Predicate Syntax | Teradata Vantage - IN/NOT IN Predicate Syntax - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢
expression_1 [NOT] IN
  { expression_2 | ( literal_specification [ { OR | , }...] ) }

Syntax Elements

expression_1
The value of the expression whose existence is to be tested in expression_2 or in an explicit list of literals named by literal, signed_literal TO signed_literal, or datetime_literal.
The expression_1 data type and the literal values must be compatible. Implicit conversion rules are the same as for the comparison operators.
IN
Specifies whether the test is inclusive or exclusive.
You can substitute any of the following for IN unless a list of literals is specified and includes signed_literal_1 TO signed_literal_2:
  • IN ANY
  • IN SOME
  • = ANY
  • = SOME5
You can substitute:
  • <> ALL
  • NOT IN ALL
expression_2
The value in which the existence of expression_1 is to be tested.
literal_specification
{ literal |
  signed_literal_1 TO signed_literal_2 |
  datetime_literal
}
literal
  • literal
  • macro parameter
  • built-in value such as TIME or DATE
signed_literal_1 TO signed_literal_2
A range of literals.
datetime_literal
An ANSI DateTime literal.