LIMIT restricts the number of rows returned by a query. It is commonly supported by databases such as MySQL, PostgreSQL, and SQLite.
Limiting results is useful when exploring large datasets or retrieving only a small number of records.
Return the first 10 employees.
SELECT
*
FROM Employees
LIMIT 10;
Analysts use LIMIT during data exploration, testing, previewing results, and retrieving top records in supported database systems.
- LIMIT restricts returned rows.
- It is common in MySQL, PostgreSQL, and SQLite.
- SQL Server uses TOP or OFFSET/FETCH instead.
- LIMIT is useful for testing queries.
- LIMIT does not delete records.
What does LIMIT do?
LIMIT restricts the number of rows returned by a query.
Is LIMIT standard across all SQL databases?
No. Different database systems may use different syntax for limiting rows.