Chapter 8. SELECT Statement: The WHERE Clause

Introduction

In the WHERE clause, a condition is used to select rows from the intermediate result of the FROM clause. These selected rows form the intermediate result of the WHERE clause. The WHERE clause acts as a kind of filter. In this chapter, we describe the different conditions permitted in this clause.

How is a WHERE clause processed? One by one, each row that appears in the intermediate result table of a FROM clause is evaluated, and the value of the condition is determined. That value can be true, false, or unknown. A row is included in the (intermediate) result of the WHERE clause only if the condition is true. If the condition is false or unknown, the row is kept out of the result. This process ...

Get Introduction to SQL: Mastering the Relational Database Language, Fourth Edition/20th Anniversary Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.