SQL Server 的语法:
SELECT TOP number|percent column_name(s) FROM table_name
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
SELECT *
FROM (select rownum as r,directory,content from sql) tab
WHERE tab.r>ceil(sum/pagesize)*(page-1) and tab.r<=ceil(sum/pagesize)*(page-1)
sum--总条数
pagesize--一页多少条
page--第几页
原文地址:https://www.cnblogs.com/xiao-si-chao/p/9322706.html
时间: 2024-11-05 03:09:09