SQL SELECT TOP, LIMIT and ROWNUM Keywords
Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
SQL SELECT TOP, LIMIT and ROWNUM Keywords
❮ SQL Keywords Reference
SELECT TOP, LIMIT and ROWNUM
The SELECT TOP
command is used to specify the number of records to return.
Note: Not all database systems support
. MySQL
SELECT TOP
uses LIMIT
, and Oracle uses
.
ROWNUM
The following SQL statement selects the first three records from the "Customers" table:
Example
SELECT TOP 3 * FROM Customers;
Try it Yourself »
The following SQL statement shows the equivalent example using the LIMIT clause:
Example
SELECT * FROM Customers
LIMIT 3;
Try it Yourself »
The following SQL statement shows the equivalent example using ROWNUM:
Example
SELECT * FROM Customers
WHERE ROWNUM <= 3;
❮ SQL Keywords Reference