oracle 笔记 VII 之 大数据量下的分页
在ORACLE 大数据量下的分页解决方法。一般用截取ID 方法,还有是三层 嵌套方法
一种分页方法
<%
int i = 1;
int numPages = 14;
String pages = request.getParameter("page");
int currentPage = 1;
currentPage = (pages == null)?1:Integer.parseInt(pages);
sql = "select count(*) from tables";
ResultSet rs = DBLink.executeQuery(sql);
第36页 共 59 页
while(rs.next())
i = rs.getInt(1);
int PageCount = 1;
PageCount = (i%numPage == 0) ?(i/numPages):(i/numPages+1);
int nextPage;
int up Page;
nextPage = currentPage + 1;
if(nextPage > = PageCount)
nextPage = PageCount;
upPage = currentPage - 1;
if(upPage <=1)
upPage = 1;
rs.close();
sql="select * from tables";
rs = DBLink.executeQuery(sql);
i = 0;
while((i<numPages*(currentPage-1)) && rs.next())
{ i++;}
//输出内容
//输出翻页连接
合计:<%=currentPage%>/<%=intPageCount%>页
<a href="List.jsp?page=1">第一页</a>
<a href="List.jsp?page=<%=upPage%>">上一页</a>
<%
for(int j=1;j<PageCount;j++){
if(currentPage != j)
&
相关文档:
在Oracle中可以创建组合索引,即同时包含两个或两个以上列的索引。在组合索引的使用方面,Oracle有以下特点:
1、 当使用基于规则的优化器(RBO)时,只有当组合索引的前导列出现在SQL语句的where子句中时,才会使用到该索引;
2、 在使用Oracle9i之前的基于成本的优化器(CBO)时 ......
2.根据Oracle 数据库scott 模式下的emp 表和dept 表,完成下列操作:
(1) 查询20号部门的所有员工信息;
(2) 查询所有工种为CLERK 的员工的员工号、员工名和部门号;
(3) 查询奖金COMM 高于工资SAL 的员工信息;
  ......
1. ASCII
返回与指定的字符对应的十进制数;
SQL> select ascii(A) A,ascii(a) a,ascii(0) zero,ascii( ) space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32
2. CHR
给出整数,返回对应的字符;
SQL> select chr(54740) zhao,chr(65) chr65 from ......
oracle的分析函数over 及开窗函数
一:分析函数over
Oracle从8.1.6开始提供分析函数,分析函数用于计算基于组的某种聚合值,它和聚合函数的不同之处是
对于每个组返回多行,而聚合函数对于每个组只返回一行。
下面通过几个例子来说明其应用。 &nb ......