Previous Topic: FROM ClauseNext Topic: GROUP BY Clause


WHERE Clause

WHERE search-condition

Produces an intermediate result table by applying the search-condition to each row of table R, which is the result of the FROM clause. The result table contains the rows of R for which the search condition is true.

Note: If using alternate-join-type, see the additional information about WHERE clauses in WHERE Clause. Also, in addition to the information about search conditions that follows, see the additional alternate-join-type search condition.

The search-condition describes a search condition that conforms to the following rules:

  1. The condition is formed (see Search Conditions).
  2. Each column-name in the search-condition either unambiguously identifies a column of R, or is a correlated reference. A correlated reference is allowed only in a subquery.
  3. A column-name in the search-condition does not identify a column that is derived from a function or a grouping column. A column of a view can be derived from a function or a grouping column.
  4. The search condition does not include a function unless the argument of the function is a correlated reference. This is only possible in a subquery of a HAVING clause.

Any subquery in the search-condition is effectively executed for each row of R and the results used in the application of the search-condition to the given row of R. A subquery is actually executed for each row of R only if it includes a correlated reference to a column of R.