DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Restrict the Number of Rows

  1. #1
    Join Date
    Jun 2002
    Posts
    3

    Exclamation

    Hi Friends,
    I would like to frame a SQL Query to a specified number of Rows say 10 Only.

    Thanks in Advance
    Jagadish

  2. #2
    Join Date
    Jun 2002
    Posts
    22
    Select * from temp_table where rownum < 11
    Aleš

  3. #3
    Join Date
    May 2002
    Posts
    2,645
    And the use of rownum, which is a pseudo column, won't always return the same rows. It depends on what else you are doing (sort, order, group by, having, and doing nothing to sort the data may return entirely different rows). If you don't care which 10 rows come out, then what Ao wrote will work for you.

    Also, you can only do "where rownum=1" or "where rownum < some_number." For example, you can't do "where rownum=5."

  4. #4
    Join Date
    Jun 2002
    Posts
    3
    What parameter needs to set in SQL Plus for the SQL
    select * from temp_table where rownum <= 10;
    query to work;
    B'cos it didn't work for me

  5. #5
    Join Date
    Apr 2002
    Location
    Philippines
    Posts
    77
    Hi Mgjagadish,

    Please post the error message.

    skid

  6. #6
    Join Date
    Jun 2002
    Posts
    3
    When I ran query with table having 25 Columns .The Query runs for quite a long time .Also I had to use Control-c to stop it.It does display error msg.Is there any set parameter to be used for query listing to page by page.Do I need to chk for something.

    Thanks & Regards
    Jagadish

Posting Permissions

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


Click Here to Expand Forum to Full Width