EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Page 258

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Search conditions
240
The different types of search condition are discussed in the following
sections.
Subqueries in search conditions
Subqueries that return exactly one column and either zero or one row can be
used in any SQL statement wherever a column name could be used,
including in the middle of an expression.
For example, expressions can be compared to subqueries in comparison
conditions (see "Comparison operators" on page 225) as long as the subquery
does not return more than one row. If the subquery (which must have one
column) returns one row, then the value of that row is compared to the
expression. If a subquery returns no rows, its value is NULL.
Subqueries that return exactly one column and any number of rows can be
used in IN conditions, ANY conditions, and ALL conditions. Subqueries that
return any number of columns and rows can be used in EXISTS conditions.
These conditions are discussed in the following sections.
ALL or ANY conditions
The syntax for ANY conditions is
...
expression
compare
ANY (
subquery
)
where compare is a comparison operator.
For example, an ANY condition with an equality operator,
...
expression
= ANY (
subquery
)
is TRUE if expression is equal to any of the values in the result of the
subquery, and FALSE is the expression is not NULL and does not equal any
of the columns of the subquery. The ANY condition is UNKNOWN if
expression is the NULL value, unless the result of the subquery has no rows,
in which case the condition is always FALSE.
The keyword SOME can be used instead of ANY.
ANY and ALL subqueries are compatible between Adaptive Server
Enterprise and Adaptive Server Anywhere. Only Adaptive Server
Anywhere supports SOME as a synonym for ANY.
BETWEEN conditions
The syntax for BETWEEN conditions is as follows:
Compatibility

Table of Contents

Related product manuals