📜  oracle 分页查询偏移量 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:17.399000             🧑  作者: Mango

代码示例1
SELECT * FROM (
    SELECT a.*, rownum rn
    FROM (
        SELECT * FROM ORDERS WHERE CustomerID LIKE 'A%'
        ORDER BY OrderDate DESC, ShippingDate DESC
    ) a
    WHERE rownum < ((pageNumber * pageSize) + 1 )
)
WHERE rn >= (((pageNumber-1) * pageSize) + 1);