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

Thread: How to make a limit on query return?

  1. #1
    Join Date
    Nov 2000
    Posts
    164
    I try to select query an output that will limit the number or records returned, such as 10, how do I make such query?

  2. #2
    Join Date
    Feb 2001
    Posts
    184
    Just at the End add
    Where Rownum <= 10

    Hope it will work.
    Thanks

  3. #3
    Join Date
    Nov 2000
    Posts
    164
    Thanks, it works!

  4. #4
    Join Date
    Jun 2000
    Posts
    26
    Be careful with this if you're using an order by clause.

    e.g. select * from emp
    where rownum <= 10
    order by emp_no

    will return the first 10 rows and then sort them by emp_no.

    It will not sort the data before selecting 10 rows.

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