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

LIMIT

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


Syntax & Overview

LIMIT 20 OFFSET 40

Caps returned row count.

Notes & Best Practices

Example

SELECT id, title
FROM posts
ORDER BY created_at DESC, id DESC
LIMIT 20;

Linked from

Related notes