Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Location
    delhi india
    Posts
    2

    Unanswered: Retrive few records from large table

    I my database there are around ten million rows. if i execute a simple select statement, it tooks long time (i don't know really). but the result does not even return after 20 - 25 minutes. is there any way that i get first 50 records then again executing a statement the next 50 records appear in the database. I feel it would be posible and work fast. but I don't know how. can anybody help

  2. #2
    Join Date
    Jan 2003
    Location
    Woking
    Posts
    107

    Re: Retrive few records from large table

    Originally posted by Decent error
    I my database there are around ten million rows. if i execute a simple select statement, it tooks long time (i don't know really). but the result does not even return after 20 - 25 minutes. is there any way that i get first 50 records then again executing a statement the next 50 records appear in the database. I feel it would be posible and work fast. but I don't know how. can anybody help
    Hi,

    SELECT /*+ FIRST_ROWS */ COL1,COL2 FROM TABLE1;

    Hope it Helps.
    nn

  3. #3
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181
    You could use rownum as follows:

    select * from table
    where rownum<51;

    Hope it helps,
    Breen.

  4. #4
    Join Date
    Jan 2003
    Location
    brooklyn
    Posts
    3
    you may use table functions to retrieve firs 50 then second 50 and so on. serch for table functions you'll get some scripts.
    tulay

  5. #5
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482

    Thumbs up

    If you table has a PK, then write a cursor to select on batches. You can fetch the cursor columns into variables, and then show them with DBMS_OUTPUT.PUT_LINE();

    And don't forget SET SERVEROUTPUT ON...


    Hope that helps,

    clio_usa - OCP - DBA


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •