mssql:
select * from ( select top size * from ( select top (start*size) * from table_name order by by id asc ) as asystable order by id desc ) as bsystable order by id asc
size:每次獲取的記錄數
start:請求的頁數
mysql(sqllite分頁也和mysql一樣):
select * from table_name limit start,pagenum
start:取資料的定位點 [開始是從0開始]
pagenum:每次取多少
比如:start=0|agenum=5
那麼就是說,取1-6 條資料
oracle:
select * from (select a.*, rownum row_num from ( table_name ) a) b
where b.row_num between 1
and 3
這是取table_name第一到第三條記錄
各類資料庫分頁共享
mssql select from select top size from select top start size from table name order by by id asc as asystable order by id desc as bsystable order by id...
各類資料庫分頁操作總結
1.oracle資料庫分頁 select from selecta.rownum rcfrom表名whererownum endrow awherea.rc startrow 2.db2資料庫分頁 select from selectrownumber over asrc,a.from select...
資料庫分頁
mysql 分頁採用limt 關鍵字select from t order limit 5,10 返回第6 15 行資料 select from t order limit 5 返回前5 行 select from t order limit 0,5 返回前5 行 mssql 2000 分頁採用to...