clause

FETCH FIRST

Limits output to a requested number of rows. Use a deterministic ordering for reproducible selection. Example target: PostgreSQL 17 (documentation target; execution pending).

Formal Syntax & Structure

sql syntaxsql
FETCH FIRST count ROWS ONLY

Working Example

Example Snippetsql
SELECT id FROM orders ORDER BY id FETCH FIRST 2 ROWS ONLY;
SQL Reference