SQL SELECT TOP, LIMIT, ROWNUM 子句

SQL Server / MS Access 语法

SELECT TOP number|percent column_name(s)
FROM table_name;

实例

SELECT TOP 50 PERCENT * FROM Websites;

MySQL 语法

 

SELECT column_name(s)
FROM table_name
LIMIT number;

实例

SELECT *
FROM Persons
LIMIT 5;

Oracle 语法

SELECT column_name(s)
FROM table_name
WHERE ROWNUM <= number;

实例

SELECT *
FROM Persons
WHERE ROWNUM <=5;

 

你可能感兴趣的:(数据库)