Results 1 to 2 of 2

Thread: how to use paging in sql

  1. #1
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    how to use paging in sql

    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


  2. #2
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    Re: how to use paging in sql

    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,ROWNUM rank from from_list where where_list)a
    where rank between :1 and :2;

    where :1 and :2 are starting and ending record numbers of the current page....

    Hope this helps u...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact