本站不再更新,歡迎光臨 java開發(fā)技術(shù)網(wǎng)
          隨筆-230  評論-230  文章-8  trackbacks-0
          用rownum實現(xiàn)大于、小于邏輯(返回rownum在4—10之間的數(shù)據(jù))(minus操作,速度會受影響)?
          select rownum,month,sell from sale where rownum<10?
          minus?
          select rownum,month,sell from sale where rownum<5;?

          返回第5—9條紀(jì)錄,按月份排序?
          select * from (select rownum row_id ,month,sell
          from (select month,sell from sale group by month,sell))?
          where row_id between 5 and 9;

          posted on 2006-04-03 15:55 有貓相伴的日子 閱讀(668) 評論(4)  編輯  收藏 所屬分類: pl/sql

          評論:
          # re: 使用rownum實現(xiàn)分頁 2006-05-15 16:16 | 有貓相伴的日子
          查詢分頁

          select * from (select a.* , rownum brow from (select * from service_info)a where rownum<40 ) where brow>=20;  回復(fù)  更多評論
            
          # re: 使用rownum實現(xiàn)分頁 2006-05-15 16:26 | 有貓相伴的日子
          select * from (select a.*,rownum row_id from service_info a )where row_id between 21 and 40;  回復(fù)  更多評論
            
          # re: 使用rownum實現(xiàn)分頁 2006-11-16 16:39 | 一笑而過
          其實經(jīng)過執(zhí)行計劃的檢驗:
          一樓的用的oracle常規(guī)分頁,而這種方式其實是最有效的,所以oracle也推薦這樣使用  回復(fù)  更多評論
            
          # re: 使用rownum實現(xiàn)分頁[未登錄] 2009-05-23 12:40 | hhh
          @有貓相伴的日子
          不錯SQL語音精簡了,哈... 高手  回復(fù)  更多評論
            
          本站不再更新,歡迎光臨 java開發(fā)技術(shù)網(wǎng)
          主站蜘蛛池模板: 定兴县| 中宁县| 南投市| 镇江市| 霍城县| 海林市| 宁德市| 恩平市| 阳原县| 新邵县| 横峰县| 紫云| 延川县| 大洼县| 阿勒泰市| 光山县| 富平县| 台安县| 儋州市| 兴城市| 合山市| 鹤岗市| 息烽县| 伊川县| 广汉市| 黄梅县| 镇坪县| 通河县| 临泉县| 福州市| 神农架林区| 台东市| 东海县| 柘荣县| 新绛县| 商洛市| 潜江市| 喀喇沁旗| 垫江县| 万载县| 都安|