在oracle里怎么写一个分页的查询语句
2个回答
展开全部
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
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询