分页

DEMO1:

SELECT *
  FROM (SELECT TEMP.*, ROWNUM RNUM
          FROM (SELECT t.*
                  FROM temp_20160829_2 t
                 WHERE 1 = 1
                 ORDER BY t.area_id 
                ) TEMP
         WHERE ROWNUM <= 300
        )
 WHERE RNUM >= 250

 

DEMO2:

SELECT *
  FROM (SELECT TEMP.*, ROWNUM RNUM
          FROM (SELECT *
                  FROM temp_20160829_2 t
                 WHERE 1 = 1
                 ORDER BY t.area_id
                ) TEMP
        )
 WHERE RNUM >= 30

 

posted @ 2019-01-21 11:14  xiluhua  阅读(132)  评论(0编辑  收藏  举报