ANY/ALL/SOME Predicate Syntax - 17.10 - ANY/ALL/SOME 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 quantifier ( literal [ {, | OR} ... ] ) |
  { expression | ( expression [,...] ) } quantifier ( subquery )
}

Syntax Elements

expression
An expression that specifies a value.
quantifier
{ comparison_operator [ NOT ] IN } { ALL |ANY | SOME }
literal
A literal value.
subquery
A subquery that selects the same number of expressions as are specified in the expression or list of expressions.
The subquery cannot specify a SELECT AND CONSUME statement.
comparison_operator
A comparison operator that compares the expression or list of expressions and the literals in the list (Literals syntax) or the subquery (Subquery syntax) to produce a TRUE, FALSE or UNKNOWN result.
[ NOT] IN
A predicate that tests the existence of the expression or list of expressions in the list of literals (Literals syntax) or the subquery (Subquery syntax) to produce a TRUE, FALSE, or UNKNOWN result.