Results 1 to 2 of 2

Thread: retrive first n rows in a query

  1. #1
    Join Date
    Mar 2005
    Posts
    22

    retrive first n rows in a query

    In postgres to retrive first n rows we'll use the key word limit. In Oracle how this is possible.

    For example in postgres,
    select * from emp limit 10 /* retrives first 10 rows of emp */

    In oracle this is possible by rownum

    select * from emp where rownum <=10.

    Is there any other way of doing it.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    rownum works fine. Otherwise you will have to write a complex query.

Posting Permissions

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