1.[color=red]oracle[/color]
2.[color=red]mysql[/color]
3.[color=red]SQL Server[/color]:
4.[color=red]DB2[/color]
select * from (select *,rownum rm from tableName where rownum>=max) where rm<=min;2.[color=red]mysql[/color]
select * from tableName limit min,max;3.[color=red]SQL Server[/color]:
select top @pagesize * from tablename where id not in (select top @pagesize*(@page-1) id from tablename order by id) order by id 4.[color=red]DB2[/color]
select * from (select *,rownumber() as ROW_NEXT from tablename) where ROW_NEXT between min and max
本文提供了在不同数据库系统中实现分页查询的SQL语句示例,包括Oracle、MySQL、SQL Server及DB2等。每种数据库都有其特有的分页查询语法,如使用ROWNUM、LIMIT或TOP关键字。
31万+

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



