Created
December 9, 2015 19:38
-
-
Save searock/32c2b31288619b5b48c9 to your computer and use it in GitHub Desktop.
Oracle pagination query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM (SELECT R.*, ROWNUM RNUM, COUNT(*) OVER () RESULT_COUNT | |
FROM (SELECT i.ITEM_CODE, i.ITEM_NAME | |
FROM TBL_ITEMS i) R) | |
WHERE RNUM between 0 and 9 ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To select all columns use i.*
Row number can start from 1 and can limit to 10 for fetching 10 records