Skip to content

Instantly share code, notes, and snippets.

@mahedi2014
Created November 8, 2015 06:58
Show Gist options
  • Save mahedi2014/92e76743fbf5992d0ddc to your computer and use it in GitHub Desktop.
Save mahedi2014/92e76743fbf5992d0ddc to your computer and use it in GitHub Desktop.
Oracle limit query like mysql
###Query
select * from
( select temp_table.*, ROWNUM rnum from
( <your_query_goes_here, with order by> ) temp_table
where ROWNUM <= :MAX_ROW_TO_FETCH )
where rnum >= :MIN_ROW_TO_FETCH;
###Instruction
:MAX_ROW_TO_FETCH is the maximum limit of row that be displayed
:MIN_ROW_TO_FETCH is minimum row num that to be start from displayed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment