ANY/ALL/SOME Predicate Syntax - ANY/ALL/SOME Predicate Syntax - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢
{ 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.