Pagination Query [message #599895] |
Wed, 30 October 2013 02:04 |
|
rameshaimhigh@gmail.com
Messages: 10 Registered: October 2013
|
Junior Member |
|
|
Hi,
Basically, we had requirement to show only 10 records per page.
So we are using the below Query
SELECT *
FROM ( SELECT d.*,
ROWNUM rnum
FROM ( SELECT level num
FROM DUAL
CONNECT BY LEVEL <= 50
)d
WHERE ROWNUM <= ( :p_page_no * :p_results_per_page)
)
WHERE rnum > ( ( :p_page_no -1 ) * :p_results_per_page)
But now we had some changed requirement like
If p_page_no = 1
then
i need to give result 1- 5
if p_page_no =2
i need to give result 6- 15
if p_page_no =3
i need to give result 16- 25
if p_page_no =4
vice versa
end if;
Can any one change this Query and get back to us. Since we are using this in complex Query please give us the solution without impact performance
|
|
|
|