SQLSELECT TOP, LIMIT and ROWNUM Keywords
SELECT TOP, LIMIT and ROWNUM
TheLIMIT,SELECT TOP orROWNUM command is used to specify the number of records to return.
Note: SQL Server usesSELECT TOP. MySQL usesLIMIT, and Oracle usesROWNUM.
The following SQL statement selects the first three records from the "Customers" table (SQL SERVER):
The following SQL statement shows the equivalent example using the LIMIT clause (MySQL):
The following SQL statement shows the equivalent example using ROWNUM (Oracle):
Example
SELECT * FROM Customers
WHERE ROWNUM <= 3;
WHERE ROWNUM <= 3;

