首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

惯用数据库分页查询sql语句

2012-07-02 
常用数据库分页查询sql语句1.oracleselect * from (select *,rownum rm from tableName where rownummax

常用数据库分页查询sql语句
1.oracle

select * from (select *,rownum rm from tableName where rownum>=max) where rm<=min;


2.mysql
select * from tableName limit min,max;


3.SQL Server:
select top @pagesize * from tablename where id not in (select top @pagesize*(@page-1) id from tablename order by id) order by id 


4.DB2
select * from (select *,rownumber() as ROW_NEXT from tablename) where ROW_NEXT between min and max 

热点排行