日期:2014-05-16  浏览次数:20767 次

常用数据库分页查询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