- The LIMIT or TOP clause is used to restrict the number of rows returned by a query.
- TOP is used in SQL Server, while LIMIT is common in MySQL and PostgreSQL.
- It helps preview data without scanning the full table.
- In my project, we used TOP 100 to quickly validate extracted data.
- It is also useful for performance testing and sampling.
- LIMIT is often combined with ORDER BY to get recent or top records.
- This makes data exploration faster and more efficient.
What is the LIMIT or TOP clause and when is it used?
Updated on January 8, 2026
< 1 min read
