On this page
  1. WHERE
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

WHERE

Prev: `LEFT JOIN` | Up: clauses | Next: `GROUP BY`
Rel: clauses, SQL Query Execution Lifecycle
Ref: PostgreSQL — SQL Commands
Tags: #public #databases #sql #clauses #tier/core


Syntax & Overview

WHERE status = 'paid' AND total_cents >= 5000

Filters individual rows before grouping and projection.

Notes & Best Practices

Example

SELECT id, total
FROM orders
WHERE user_id = 7 AND canceled_at IS NULL;

Linked from

Related notes