The WHERE Clause

A WHERE clause is used to determine whether a row of a table must be used when composing the results of a query.

When applied to the row of a table, the WHERE clause must result in a boolean value indicating whether or not a row must be used when calculating the results of a query. The WHERE clause syntax supported by ActiveSpaces is the following:

WHERE [NOT] <predicate> [ AND | OR [NOT] <predicate> ] . . .

A predicate is a condition expression that evaluates to true or false. If the predicate evaluates to true for a row, that row is used when calculating the results of the query. For example:
 city='Chicago'
 percent<=75.0
The AND and OR operators are used to filter rows based on more than one condition. For example:
 city='Chicago' AND lastname='Dailey'
The NOT operator includes a row if the condition is not true. For example:
NOT city='Chicago'
When you create an SQL statement, the efficiency of the SQL statement depends on how well you construct a WHERE clause. For example, a WHERE clause must be used to prevent a full table scan from being done. For more information about constructing an efficient WHERE clause, see Tips on Constructing an Efficient WHERE Clause.