LIMIT in MySQL — How It Works

What the MySQL LIMIT function does, with an example.

Published October 22, 2026

LIMIT restricts the number of rows returned by a query.

Key points

  • Part of standard SQL functions available in MySQL for working with query results

Example

SELECT * FROM posts ORDER BY created_at DESC LIMIT 10;
More SQL articles