Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to select a range of records by rownum?

Re: How to select a range of records by rownum?

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/03/26
Message-ID: <5hbifp$4sa@info.csufresno.edu>#1/1

In article <33382B18.111C_at_exesolutions.com>, Daniel A. Morgan <dmorgan_at_exesolutions.com> wrote:
>> > "select rownum, user, email from clients where rownum >= 40" failed
>>
>> will never return any rows. Think about it, the first record returned
>> will have rownum = 1 which is not greater than 40 so is discarded. The
>> next record returned will still have rownum = 1 and again will be
>> discarded and so on.
>
>Wonderful. What's the solution?

Here's a solution:
  Select RNUM, user, email
    from (select rownum RNUM, user, email

            from clients)
   where RNUM >= 40

Regards,
Steve Cosner Received on Wed Mar 26 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US