Specifying Subqueries in Search Conditions - Teradata Database - Teradata Vantage NewSQL Engine

SQL Data Manipulation Language

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
fbo1512081269404.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Permits a more sophisticated and detailed query of a database through the use of nested SELECT queries.

Syntax: IN, NOT IN, ANY, SOME, and ALL Logical Predicates



Syntax Elements

expression
SQL expression.
To specify multiple expressions, enclose the expressions in PARENTHESIS characters and separate each expression with a COMMA character.
comparison_operator
SQL comparison operator.
See Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145 for information about the SQL comparison operators.
IN (in_list)
expression is either IN the parenthetically delimited list of values.
For information about the IN logical predicates and the valid expressions that you can specify in an in_list, see Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.
NOT IN (in_list)
expression is NOT IN the parenthetically delimited list of values.
For information about the NOT IN logical predicates and the valid expressions that you can specify in an in_list, see Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.
ANY
The ANY logical quantifier.
For more information about the ANY logical quantifier, see Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.
SOME
The SOME logical quantifier.
For more information about the SOME logical quantifier, see Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.
ALL
The ALL logical quantifier.
For more information about the ALL logical quantifier, see Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.
subquery
SQL subquery.

Syntax: EXISTS Logical Expression



Syntax Elements

EXISTS
The EXISTS () logical quantifier.
See Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.
subquery
SQL subquery.

ANSI Compliance

Subqueries are ANSI SQL:2011-compliant.

Related Topics

For more information related to simple subqueries, see: