本站不再更新,歡迎光臨 java開發(fā)技術(shù)網(wǎng)
          隨筆-230  評論-230  文章-8  trackbacks-0
          用rownum實(shí)現(xiàn)大于、小于邏輯(返回rownum在4—10之間的數(shù)據(jù))(minus操作,速度會(huì)受影響)?
          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 有貓相伴的日子 閱讀(671) 評論(4)  編輯  收藏 所屬分類: pl/sql

          評論:
          # re: 使用rownum實(shí)現(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實(shí)現(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實(shí)現(xiàn)分頁 2006-11-16 16:39 | 一笑而過
          其實(shí)經(jīng)過執(zhí)行計(jì)劃的檢驗(yàn):
          一樓的用的oracle常規(guī)分頁,而這種方式其實(shí)是最有效的,所以oracle也推薦這樣使用  回復(fù)  更多評論
            
          # re: 使用rownum實(shí)現(xiàn)分頁[未登錄] 2009-05-23 12:40 | hhh
          @有貓相伴的日子
          不錯(cuò)SQL語音精簡了,哈... 高手  回復(fù)  更多評論
            
          本站不再更新,歡迎光臨 java開發(fā)技術(shù)網(wǎng)
          主站蜘蛛池模板: 江山市| 青海省| 普格县| 桂平市| 恩施市| 宁河县| 合川市| 甘孜| 颍上县| 黄冈市| 黎城县| 昆山市| 河南省| 通城县| 赣州市| 余庆县| 大邑县| 和硕县| 越西县| 罗田县| 车险| 隆林| 十堰市| 龙海市| 银川市| 江口县| 霞浦县| 息烽县| 福州市| 且末县| 上饶县| 平乐县| 军事| 商丘市| 科技| 股票| 五河县| 镇平县| 镇雄县| 北流市| 德保县|