+ class="parameter">expression)
the sample variance of the input values
- The argument of EXISTS> is an arbitrary SELECT statement,
- or subquery>. The
+ The argument of EXISTStoken> is an arbitrary SELECT statement,
+ or subqueryfirstterm>. The
subquery is evaluated to determine whether it returns any rows.
- If it returns at least one row, the result of EXISTS> is
- TRUE; if the subquery returns no rows, the result of EXISTS>
+ If it returns at least one row, the result of EXISTStoken> is
+ TRUE; if the subquery returns no rows, the result of EXISTStoken>
is FALSE.
and not on the contents of those rows, the output list of the
subquery is normally uninteresting. A common coding convention is
to write all EXISTS tests in the form
- EXISTS(SELECT 1 WHERE ...)>. There are exceptions to
- this rule however, such as subqueries that use INTERSECT>.
+ EXISTS(SELECT 1 WHERE ...)literal>. There are exceptions to
+ this rule however, such as subqueries that use INTERSECTtoken>.
IN (scalar form)
-expression IN (value, ...)
+expression IN
+ ble>value, ...)
- The right-hand side of this form of IN> is a parenthesized list
+ The right-hand side of this form of INtoken> is a parenthesized list
of scalar expressions. The result is TRUE if the left-hand expression's
result is equal to any of the right-hand expressions. This is a shorthand
notation for
Note that if the left-hand expression yields NULL, or if there are
no equal right-hand values and at least one right-hand expression yields
- NULL, the result of the IN> construct will be NULL, not FALSE.
+ NULL, the result of the INtoken> construct will be NULL, not FALSE.
This is in accordance with SQL's normal rules for Boolean combinations
of NULL values.
- This form of IN> is not truly a subquery expression, but it
- seems best to document it in the same place as subquery IN>.
+ This form of INtoken> is not truly a subquery expression, but it
+ seems best to document it in the same place as subquery INtoken>.
- The right-hand side of this form of IN> is a parenthesized
+ The right-hand side of this form of INtoken> is a parenthesized
subquery, which must return exactly one column. The left-hand expression
is evaluated and compared to each row of the subquery result.
- The result of IN> is TRUE if any equal subquery row is found.
+ The result of INtoken> is TRUE if any equal subquery row is found.
The result is FALSE if no equal row is found (including the special
case where the subquery returns no rows).
Note that if the left-hand expression yields NULL, or if there are
no equal right-hand values and at least one right-hand row yields
- NULL, the result of the IN> construct will be NULL, not FALSE.
+ NULL, the result of the INtoken> construct will be NULL, not FALSE.
This is in accordance with SQL's normal rules for Boolean combinations
of NULL values.
- As with EXISTS>, it's unwise to assume that the subquery will
+ As with EXISTStoken>, it's unwise to assume that the subquery will
be evaluated completely.
-(expression, expression, ...) IN (subquery)
+(expression,
+ble>expresnal>,nal>)
+ IN (subquery)
- The right-hand side of this form of IN> is a parenthesized
+ The right-hand side of this form of INtoken> is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand list. The left-hand expressions are
evaluated and compared row-wise to each row of the subquery result.
- The result of IN> is TRUE if any equal subquery row is found.
+ The result of INtoken> is TRUE if any equal subquery row is found.
The result is FALSE if no equal row is found (including the special
case where the subquery returns no rows).
are unequal if any corresponding members are non-null and unequal;
otherwise the result of that row comparison is unknown (NULL).
If all the row results are either unequal or NULL, with at least one NULL,
- then the result of IN> is NULL.
+ then the result of INtoken> is NULL.
NOT IN (scalar form)
-expression NOT IN (value, ...)
+expression NOT IN
+ ble>value, ...)
- The right-hand side of this form of NOT IN> is a parenthesized list
+ The right-hand side of this form of NOT INtoken> is a parenthesized list
of scalar expressions. The result is TRUE if the left-hand expression's
result is unequal to all of the right-hand expressions. This is a shorthand
notation for
Note that if the left-hand expression yields NULL, or if there are
no equal right-hand values and at least one right-hand expression yields
- NULL, the result of the NOT IN> construct will be NULL, not TRUE
+ NULL, the result of the NOT INtoken> construct will be NULL, not TRUE
as one might naively expect.
This is in accordance with SQL's normal rules for Boolean combinations
of NULL values.
- x NOT IN y> is equivalent to NOT (x IN y)> in all
+ x NOT IN yliteral> is equivalent to NOT (x IN y)> in all
cases. However, NULLs are much more likely to trip up the novice when
- working with NOT IN> than when working with IN>.
+ working with NOT INtoken> than when working with IN>.
It's best to express your condition positively if possible.
- The right-hand side of this form of NOT IN> is a parenthesized
+ The right-hand side of this form of NOT INtoken> is a parenthesized
subquery, which must return exactly one column. The left-hand expression
is evaluated and compared to each row of the subquery result.
- The result of NOT IN> is TRUE if only unequal subquery rows
+ The result of NOT INtoken> is TRUE if only unequal subquery rows
are found (including the special case where the subquery returns no rows).
The result is FALSE if any equal row is found.
Note that if the left-hand expression yields NULL, or if there are
no equal right-hand values and at least one right-hand row yields
- NULL, the result of the NOT IN> construct will be NULL, not TRUE.
+ NULL, the result of the NOT INtoken> construct will be NULL, not TRUE.
This is in accordance with SQL's normal rules for Boolean combinations
of NULL values.
- As with EXISTS>, it's unwise to assume that the subquery will
+ As with EXISTStoken>, it's unwise to assume that the subquery will
be evaluated completely.
-(expression, expression, ...) NOT IN (subquery)
+(expression,
+ble>expresnal>,nal>)
+ NOT IN (subquery)
- The right-hand side of this form of NOT IN> is a parenthesized
+ The right-hand side of this form of NOT INtoken> is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand list. The left-hand expressions are
evaluated and compared row-wise to each row of the subquery result.
- The result of NOT IN> is TRUE if only unequal subquery rows
+ The result of NOT INtoken> is TRUE if only unequal subquery rows
are found (including the special case where the subquery returns no rows).
The result is FALSE if any equal row is found.
are unequal if any corresponding members are non-null and unequal;
otherwise the result of that row comparison is unknown (NULL).
If all the row results are either unequal or NULL, with at least one NULL,
- then the result of NOT IN> is NULL.
+ then the result of NOT INtoken> is NULL.
ANY
-expression operator ANY (subquery)
-expression operator SOME (subquery)
+expression
+ble>operble> ANY (subquery)
+expression
+ble>operble> SOME (subquery)
- The right-hand side of this form of ANY> is a parenthesized
+ The right-hand side of this form of ANYtoken> is a parenthesized
subquery, which must return exactly one column. The left-hand expression
is evaluated and compared to each row of the subquery result using the
given operator, which must yield a Boolean
result.
- The result of ANY> is TRUE if any true result is obtained.
+ The result of ANYtoken> is TRUE if any true result is obtained.
The result is FALSE if no true result is found (including the special
case where the subquery returns no rows).
- SOME> is a synonym for ANY>.
- IN> is equivalent to = ANY>.
+ SOMEtoken> is a synonym for ANY>.
+ INtoken> is equivalent to = ANY>.
Note that if there are no successes and at least one right-hand row yields
- NULL for the operator's result, the result of the ANY> construct
+ NULL for the operator's result, the result of the ANYtoken> construct
will be NULL, not FALSE.
This is in accordance with SQL's normal rules for Boolean combinations
of NULL values.
- As with EXISTS>, it's unwise to assume that the subquery will
+ As with EXISTStoken>, it's unwise to assume that the subquery will
be evaluated completely.
-(expression, expression, ...) operator ANY (subquery)
-(expression, expression, ...) operator SOME (subquery)
+(expression,
+ble>expresnal>,optionaaceable>aceable> ANY (subquery)
+(expression,
+ble>expresnal>,optionaaceable>aceable> SOME (subquery)
- The right-hand side of this form of ANY> is a parenthesized
+ The right-hand side of this form of ANYtoken> is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand list. The left-hand expressions are
evaluated and compared row-wise to each row of the subquery result,
using the given operator. Presently,
- only => and <>> operators are allowed
- in row-wise ANY> queries.
- The result of ANY> is TRUE if any equal or unequal row is
+ only =literal> and <>> operators are allowed
+ in row-wise ANYtoken> queries.
+ The result of ANYtoken> is TRUE if any equal or unequal row is
found, respectively.
The result is FALSE if no such row is found (including the special
case where the subquery returns no rows).
equal if all their corresponding members are non-null and equal; the rows
are unequal if any corresponding members are non-null and unequal;
otherwise the result of that row comparison is unknown (NULL).
- If there is at least one NULL row result, then the result of ANY>
+ If there is at least one NULL row result, then the result of ANYtoken>
cannot be FALSE; it will be TRUE or NULL.
ALL
-expression operator ALL (subquery)
+expression
+ble>operble> ALL (subquery)
- The right-hand side of this form of ALL> is a parenthesized
+ The right-hand side of this form of ALLtoken> is a parenthesized
subquery, which must return exactly one column. The left-hand expression
is evaluated and compared to each row of the subquery result using the
given operator, which must yield a Boolean
result.
- The result of ALL> is TRUE if all rows yield TRUE
+ The result of ALLtoken> is TRUE if all rows yield TRUE
(including the special case where the subquery returns no rows).
The result is FALSE if any false result is found.
- NOT IN> is equivalent to <> ALL>.
+ NOT INtoken> is equivalent to <> ALL>.
Note that if there are no failures but at least one right-hand row yields
- NULL for the operator's result, the result of the ALL> construct
+ NULL for the operator's result, the result of the ALLtoken> construct
will be NULL, not TRUE.
This is in accordance with SQL's normal rules for Boolean combinations
of NULL values.
- As with EXISTS>, it's unwise to assume that the subquery will
+ As with EXISTStoken>, it's unwise to assume that the subquery will
be evaluated completely.
-
+
(expression, expression, ...) operator ALL (subquery)
-
+
- The right-hand side of this form of ALL> is a parenthesized
+ The right-hand side of this form of ALLtoken> is a parenthesized
subquery, which must return exactly as many columns as there are
expressions in the left-hand list. The left-hand expressions are
evaluated and compared row-wise to each row of the subquery result,
using the given operator. Presently,
- only => and <>> operators are allowed
- in row-wise ALL> queries.
- The result of ALL> is TRUE if all subquery rows are equal
+ only =literal> and <>> operators are allowed
+ in row-wise ALLtoken> queries.
+ The result of ALLtoken> is TRUE if all subquery rows are equal
or unequal, respectively (including the special
case where the subquery returns no rows).
The result is FALSE if any row is found to be unequal or equal,
equal if all their corresponding members are non-null and equal; the rows
are unequal if any corresponding members are non-null and unequal;
otherwise the result of that row comparison is unknown (NULL).
- If there is at least one NULL row result, then the result of ALL>
+ If there is at least one NULL row result, then the result of ALLtoken>
cannot be TRUE; it will be FALSE or NULL.
Row-wise comparison
-
+
(expression, expression, ...) operator (subquery)
-(expression, expression, ...) operator (expression, expression, ...)
-
+(expression, expression, ...) operator (expression expression, ...)
+
The left-hand side is a list of scalar expressions. The right-hand side
return more than one row. (If it returns zero rows, the result is taken to
be NULL.) The left-hand side is evaluated and compared row-wise to the
single subquery result row, or to the right-hand expression list.
- Presently, only => and <>> operators are allowed
+ Presently, only =literal> and <>> operators are allowed
in row-wise comparisons.
The result is TRUE if the two rows are equal or unequal, respectively.