您的位置:首页 > 数据库 > Oracle

Oracle中分页查询语句

2014-04-03 15:28 501 查看
oracle分页有通用写法,假设一页5行
select * from (
select t.*,rownum from (
select * from table1 where condition order by column) t )
where rownum>(pangeNow-1)*5 and rownum<=(pageNow)*5

如果基础查询不需要排序,可以省掉一层嵌套
select * from (
select t.*,rownum from table1 t where condition )
where rownum>(pangeNow-1)*5 and rownum<=(pageNow)*5
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: