📜  sql 分页 oracle - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:19.584000             🧑  作者: 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);