oracle数据中分页的sql语句

时间:2021-07-03 06:22:41

SELECT *
  FROM (SELECT T.*, ROWNUM RN
          FROM (select t.jh,
                       t.depth,
                       t.vdepth,
                       t.rt1,
                       t.rt2,
                       t.rt3,
                       t.gr,
                       t.ac,
                       t.den,
                       t.cnl
                  from LWD t
                 ) T
         WHERE  ROWNUM <= 10)
 WHERE RN >= 1

mybatis xml的写法

SELECT *
  FROM (SELECT T.*, ROWNUM RN
          FROM (
                select t.jh,
                        t.depth,
                        t.vdepth,
                        t.rt1,
                        t.rt2,
                        t.rt3,
                        t.gr,
                        t.ac,
                        t.den,
                        t.cnl
                  from LWD t) T
         WHERE < ! [ CDATA [ ROWNUM <= #{end}] ] >)
 WHERE RN >= #{start}