Specifying Subqueries in Search Conditions - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
16.10
Published
June 2017
Language
English (United States)
Last Update
2018-04-25
dita:mapPath
psg1480972718197.ditamap
dita:ditavalPath
changebar_rev_16_10_exclude_audience_ie.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

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 them within PARENTHESIS characters and separate each expression with a COMMA character.
comparison_operator
SQL comparison operator.
See SQL Functions, Operators, Expressions, and Predicates 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 SQL Functions, Operators, Expressions, and Predicates .
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 SQL Functions, Operators, Expressions, and Predicates .
ANY
The ANY logical quantifier.
See SQL Functions, Operators, Expressions, and Predicates for more information about the ANY logical quantifier.
SOME
The SOME logical quantifier.
See SQL Functions, Operators, Expressions, and Predicates for more information about the SOME logical quantifier.
ALL
The ALL logical quantifier.
See SQL Functions, Operators, Expressions, and Predicates for more information about the ALL logical quantifier.
subquery
SQL subquery.

Syntax: EXISTS Logical Expression



Syntax Elements

EXISTS
The EXISTS () logical quantifier.
See SQL Functions, Operators, Expressions, and Predicates .
subquery
SQL subquery.

ANSI Compliance

Subqueries are ANSI SQL:2011-compliant.

Related Topics

For more information related to simple subqueries, see: