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

          返回第5—9條紀錄,按月份排序?
          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 有貓相伴的日子 閱讀(672) 評論(4)  編輯  收藏 所屬分類: pl/sql

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

          select * from (select a.* , rownum brow from (select * from service_info)a where rownum<40 ) where brow>=20;  回復  更多評論
            
          # re: 使用rownum實現分頁 2006-05-15 16:26 | 有貓相伴的日子
          select * from (select a.*,rownum row_id from service_info a )where row_id between 21 and 40;  回復  更多評論
            
          # re: 使用rownum實現分頁 2006-11-16 16:39 | 一笑而過
          其實經過執行計劃的檢驗:
          一樓的用的oracle常規分頁,而這種方式其實是最有效的,所以oracle也推薦這樣使用  回復  更多評論
            
          # re: 使用rownum實現分頁[未登錄] 2009-05-23 12:40 | hhh
          @有貓相伴的日子
          不錯SQL語音精簡了,哈... 高手  回復  更多評論
            
          本站不再更新,歡迎光臨 java開發技術網
          主站蜘蛛池模板: 大连市| 旬邑县| 乌兰县| 芦溪县| 固镇县| 芒康县| 彭泽县| 英吉沙县| 勃利县| 红河县| 古蔺县| 宜宾市| 红安县| 禹城市| 龙游县| 静安区| 嘉黎县| 上饶市| 邢台市| 永昌县| 大埔县| 莆田市| 黄陵县| 南平市| 波密县| 穆棱市| 长寿区| 化德县| 柘城县| 万山特区| 盐山县| 曲阜市| 苍溪县| 富民县| 巴青县| 巧家县| 清远市| 望城县| 横峰县| 壶关县| 龙井市|