Java Fly

          Java&Oracle
          隨筆 - 12, 文章 - 20, 評論 - 27, 引用 - 0
          數據加載中……

          Oralce 分頁

          ?
          ????????? 在oracle數據庫中查詢結果的行號使用偽列ROWNUM表示(從1開始)。例如select * from employee where rownum<10 返回前10條記錄。但因為rownum是在查詢之后排序之前賦值的,所以查詢employee按birthday排序的第100到120條記錄應該這么寫:
                  select * from (
          select my_table.*, rownum as my_rownum from (
          select name, birthday from employee order by birthday
          ) my_table where rownum <120
          ) where my_rownum>=100
          //記算總頁數 
          intPageCount = (intRowCount+intPageSize-1) / intPageSize;

          posted on 2006-09-04 12:47 Java Fly 閱讀(460) 評論(0)  編輯  收藏 所屬分類: Oracle命題

          主站蜘蛛池模板: 长乐市| 张家港市| 锦屏县| 嵩明县| 塘沽区| 宁远县| 宿州市| 大城县| 荆门市| 孟连| 横山县| 渝北区| 仁怀市| 丹棱县| 拉萨市| 聂荣县| 安徽省| 陕西省| 大同市| 山东| 荔波县| 枣强县| 寿光市| 梅河口市| 永春县| 隆子县| 迭部县| 友谊县| 陆河县| 西乌| 龙江县| 黄山市| 汉阴县| 边坝县| 额敏县| 稷山县| 宁武县| 泰来县| 阜城县| 青川县| 蓬安县|