Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql pagination offset

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: #sql #pagination #offset
ADD COMMENT
Topic
Name
9+1 =