IN/NOT IN Predicate Syntax | Teradata Vantage - IN/NOT IN Predicate Syntax - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
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.