i have an sql query which return huge results(about milion recods) and i want to print it in html browser. How can i use sql for paging so that i can retrieve first 100 results ,the next 100 results..and so on........
----------------------
suresh
Printable View
i have an sql query which return huge results(about milion recods) and i want to print it in html browser. How can i use sql for paging so that i can retrieve first 100 results ,the next 100 results..and so on........
----------------------
suresh
You might have find solution to ur question. Anyway let me give mine(ORACLE),
you can achieve this by the use of ROWNUM.
let us assume that the following query is ur query
select column_list from from_list where where_list;
you need to use the following query for paging,
select * from
(select column_list,[B]ROWNUM rank[/B] from from_list where where_list)a
where [B]rank between :1 and :2[/B];
where :1 and :2 are starting and ending record numbers of the current page....
Hope this helps u...