Oracle的几种分页

-- 1111111
SELECT
*
FROM
(
SELECT
 row_.*,
 ROWNUM rownum_
FROM
 ( SELECT * FROM ( SELECT * FROM LISTEDCO_COLLECT_LOG WHERE 1 = 1 AND NAME LIKE '%深圳%' ) tmp ORDER BY tmp.id DESC ) row_
WHERE
 ROWNUM <= 10
) lcl
WHERE
rownum_ > 0


-- 22222
SELECT
*
FROM
(
SELECT
 row_.*,
 ROWNUM rownum_
FROM
 ( SELECT * FROM LISTEDCO_COLLECT_LOG WHERE 1 = 1 AND NAME LIKE '%深圳%' ORDER BY id DESC ) row_
)
WHERE
ROWNUM <= 10
AND rownum_ > 0


--  33333
SELECT
*
FROM
( SELECT * FROM LISTEDCO_COLLECT_LOG WHERE 1 = 1 AND NAME LIKE '%深圳%' ORDER BY id DESC )
WHERE
ROWNUM BETWEEN 0
AND 10

发表评论