WHERE Clause

The WHERE clause filters the rows coming from the FROM clause, returning the rows satisfying a given condition.

Syntax

where_clause ::= WHERE expression

Semantics

For each context row, the expression in the WHERE clause is evaluated. The result of this expression must have type BOOLEAN?. If the result is false, or empty, or NULL, the row is skipped; otherwise the row is passed on to the next clause.

Example 6-3 WHERE Clause

SELECT * FROM users WHERE firstname ="John";

The above example selects all information for users whose first name is "John".