Home Oracle 分页的实现
Post
Cancel

Oracle 分页的实现

通用分页格式,page是页码,size是每页显示条数。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SELECT
  *
FROM
  (
    SELECT
      T.*,
      ROWNUM rn
    FROM
      (
        SELECT
          *
        FROM
          T_BASE_PROVINCE
        ORDER BY
          ID ASC
      ) T
    WHERE
      ROWNUM <= page * size
  )
WHERE
  rn > (page - 1) * size;
This post is licensed under CC BY 4.0 by the author.