oracle分页处理,oracle 中分页的处理

[注意]

1、rownum 不能直接使用> .

2、需要先排序,过滤以后再处理rownum

i、minus

这个方法因为用到了minus操作符,所以速度会受影响

select rownum,c1.* from (select t.* from carrier t where .... order by...) c1 where rownum <= 8

minus

select rownum,c2.* from (select t.* from carrier t where .... order by...) c2 where rownum <= 8

ii、select嵌套(3层)。

SELECT *

FROM (SELECT rownum rownumber, c.*

FROM (

select t.* from carrier t where .... order by .. .

) c

) cc

WHERE cc.rownumber > 8

and cc.rownumber <= 10

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
package com.list.struts.util; import java.util.ArrayList; public class Page { //当前跳转的页面情况 private String pagetype; private PaginationBean pagination; private ArrayList result; //构造函数实例化接收一个pagetype和PaginationBean对象 public Page(String pagetype, PaginationBean pagination) { this.pagetype = pagetype; this.pagination = pagination; } /** * * */ public boolean isEmpty() { if (pagetype == null || pagetype.equals("")) { return true; } else { return false; } } /** * * * */ public ArrayList getResult() { if (!isEmpty()) { if (pagetype.equals("nextPage")) { result = pagination.getNextPage(); } else if (pagetype.equals("previousPage")) { result = pagination.getPreviouspage(); } else if (pagetype.equals("lastPage")){ result = pagination.getLastPage(); } else if (pagetype.equals("firstPage")){ result = pagination.getFirstPage(); } else{ result=pagination.getJumpPage(pagetype); } } else { result = pagination.getProducts(); } return result; } /** * * * */ //此对象保存了页面的所有情况,包括多少页等信息 public PaginationBean getPagePagination() { return pagination; } /** * * */ //实例化PaginationBean的构造函数 public void Init(ArrayList result) { this.result = result; pagination = new PaginationBean(result); } } ------------------------------ import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.list.struts.form.ListForm; import com.list.struts.util.Page; import com.list.struts.util.PageBean; import com.list.struts.util.PaginationBean; import com.list.struts.vo.newgetResouce; public class ListAction extends Action { /* * Generated Method

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值