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

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)
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.