SQL LIMIT Keyword
The LIMIT clause is used to restrict the number of records returned by a query. It is supported by MySQL and SQLite, including our TechKubo playground.
Note: SELECT TOP is used in SQL Server, and ROWNUM is used in Oracle for the same purpose.
SQL LIMIT Syntax
SELECT column1, column2, ... FROM table_name LIMIT number;
SQL LIMIT First 3 Patients Example
This query selects the first 3 rows from the Patients table.
SELECT * FROM Patients LIMIT 3;

SQL LIMIT First 5 Appointments Example
This query selects the first 5 rows from the Appointments table.
SELECT * FROM Appointments LIMIT 5;
