如原本查询所有的用户名和密码
SELECT
username,
pwd
FROM
lp_sys_user
现在要进行分页
SELECT
row_.*
FROM
(
SELECT
username,
pwd,
row_number () OVER (ORDER BY id DESC) AS rownum_
FROM
lp_sys_user
) row_
WHERE
rownum_ >= 1
AND rownum_ <= 5
在原来的select加入row_number () OVER (ORDER BY id DESC) AS rownum_
然后在整条语句再套个select,并加上 WHERE rownum_ >= 1 AND rownum_ <= 5