SELECT * FROM (SELECT ROW_.*, ROWNUM ROWNUM_ FROM ( select * from table ) ROW_ WHERE ROWNUM <= v_curPage * v_pageSize) WHERE ROWNUM_ > (v_curPage - 1) * v_pageSize