Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Subquery

A subquery is a query expression that can be used in

  • As an expression:
    The subquery must return a single-column derived table with a maximum of one row. The value of the subquery is then the value in the derived table or the NULL value if the derived table is empty.

  • predicates:
    In the predicates ANY, SOME, ALL, IN and EXISTS the subquery returns a derived table.

  • In the FROM clause of SELECT expressions:
    The subquery returns a derived table.

  • In join expressions:
    The subquery returns a derived table.

A subquery is always enclosed in parentheses.


subquery ::= ( query_expression )



query_expression

Query expression that returns the derived table.

In subqueries that are not specified in the predicate EXISTS or in a FROM clause, the derived table can only contain an atomic column or multiple columns with the dimension 1.