首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

oracle 分页札记

2012-08-08 
oracle 分页笔记?-- pageIndex表示第几页-- pageSize表示每页页示的总条数/**这段SQL语句的意思是:先查询

oracle 分页笔记

?

-- pageIndex  表示第几页-- pageSize   表示每页页示的总条数/**   这段SQL语句的意思是:   先查询当前索引*每页显示的总条数据,   然后再从里面去掉前面查询的数据,并截取查询下一页要显示的数据*/ select * from (select rownum as r, t.* from(select * from house)t  where rownum<=pageIndex*pageSize) where r>(pageIndex-1)*pageSize      select * from (select rownum as r, t.* from(select * from student)t  where rownum<=3000*3) where r>(3000-1)*3    --再加个循环笔记declare i int; begin     i:=0;  loop      i:=i+1;      insert into student       values(Seq_Student_Id.Nextval,'testYY'||i,'male');        commit;           if i>10000 then      exit;      end if;   end loop;            Exception      when others then       rollback;       end ;--oracle循环语句学习网址http://www.cnblogs.com/zheng8145/archive/2008/12/02/1345930.html

热点排行