March 9th, 2009

Simple Subselects

Posted by admin in N. Subselects

A simple subselect (also known as a non-correlated subselect) is a subselect that can be evaluated without the use of the outer select.

When this is true, the subselect is processed first and only processed once, independently of the outer select, giving a temporary result table.

Then, the temporary result table is passed to the outer select for further processing to give the final result.

Simple subselects with scalar functions can only follow a comparison operator if they return just one value.
That is, the subselect must return only one row containing only one column.

Simple subselects may return multiple values, but are usable only with multivalue expressions like [NOT] IN, ANY, ALL, SOME, or [NOT] EXISTS.

The subselect may reference the same table as the outer select, or it may reference a different table.

Comments are closed.

Sorry, the comment form is closed at this time.