Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

oracle pagination query rownum

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #oracle #pagination #query #rownum
ADD COMMENT
Topic
Name
3+6 =