select * from ( select row_.*, rownum rownum_ from ( query_SQL ) row_ where rownum =< max) where rownum_ >= min
2.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
3.MySQL
select * from tablename limit position, counter
4.DB2
select * from (select *,rownumber() as ROW_NEXT from tablename) where ROW_NEXT between min and max
本文介绍了在不同数据库系统中实现分页查询的方法,包括Oracle、SQL Server、MySQL及DB2。每种数据库都提供了特有的SQL语法来实现数据的分页显示。
2234

被折叠的 条评论
为什么被折叠?



