4.1. The WHERE Clause

A lot happens in the WHERE clause. This is the place where the rows (with columns both actual and derived) from the list specified in the SELECT clause are trimmed down to only the results you need to see. Starting with the syntax described in Chapter 2, "SQL*Plus and iSQL*Plus Basics," we can expand the SELECT statement syntax as follows:

SELECT * | {[DISTINCT] column | expression [alias], ...}
   FROM tablename
[WHERE condition ... ];

The WHERE clause may have one or more conditions, separated by AND and OR and optionally grouped in parentheses to override the default precedence.

From the perspective of the table, the SELECT clause slices a table vertically, and the WHERE clause slices it horizontally.

4.1.1. Comparison ...

Get Oracle Database Foundations 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.