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

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

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

From: Mark Rosenbaum <mjr_at_netcom.com>
Date: 1997/03/24
Message-ID: <mjrE7Jr9s.DF0@netcom.com>#1/1

In article <5h5ol8$c9v$1_at_news.hkol.com>, Pao Wan <paowan_at_drdun.com> wrote:
>I want to select records from 40 to 100, and I think the statement
>
>"select rownum, user, email from clients where rownum >= 40 and rownum <=100"
>
>will work. But it failed, I tried
>
>"select rownum, user, email from clients where rownum <= 100"
>
>it work. But
>
>"select rownum, user, email from clients where rownum >= 40" failed, can
>anybody help me.
>

rownum does not increament if the test fails. Therefor rownum will always be 1 (or less than 40). The workaround is to create a view with rownum as one of the columns. When you query the view it will do what you want.

mjr Received on Mon Mar 24 1997 - 00:00:00 CST

Original text of this message

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