WHERE clause

The part of a query that keeps only the rows for which a condition is true.

In more detail

The condition is evaluated once per row; rows where it is false or unknown are dropped. In UPDATE and DELETE it chooses which rows change, so leaving it out changes every row. WHERE runs before grouping, which makes it the place for conditions about individual rows.

Examples

Scoped repositories and row-level security add the tenant WHERE clause automatically.
SELECT name, city FROM customers WHERE country = 'NG';

Related terms

Taught in

References

Certification courses