Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to select a range of records by rownum?
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
![]() |
![]() |