NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
S-6
Considerations—Search Conditions
OR
specifies that the search condition is true if either of the surrounding predicates or
search conditions are true.
AND
specifies that the search condition is true only if both the surrounding predicates or
search conditions are true.
Considerations—Search Conditions
Order of evaluation
SQL evaluates search conditions in the following order, first to last: predicates
within parentheses, NOT, AND, OR.
Column references
Within a search condition, a reference to a column refers to the value of that column
in the row evaluated by the search condition.
Subqueries
If a search condition contains a predicate of the form
expression comparison-operator subquery
and the subquery returns no values, the predicate evaluates to null.
If you include a subquery in a search condition, SQL applies the subquery to each
row of the table that is the result of the previous clauses, the uses that result to
evaluate the search condition in relation to a specific row.
Operation
A statement that contains a search condition operates on a row only if that row
satisfies the search condition. For example, in a DELETE statement, any row that
satisfies the search condition specified in the WHERE clause is deleted. In a
SELECT statement, from each row or group of rows that satisfies the search
condition, the columns specified in the select list are returned.
A search condition connected by the OR operator might execute successfully even
though it includes a predicate that can evaluate to false or null. If any predicate is
true, the values of the remaining predicates are irrelevant.
Evaluation to null
If a search condition contains a predicate of the form
expression comparison-operator subquery
and the subquery returns no values, the predicate evaluates to null.