Re: ROWNUM between 5 and 30 doesn't work

From: Ana C. Dent <anacedent_at_hotmail.com>
Date: Fri, 06 Jun 2003 18:49:08 -0700
Message-ID: <mwbEa.63201$MJ5.47148_at_fed1read03>


Sharron wrote:
> Hi, I can't seem to figure out how to get oracle to show rows other than
> rows starting from 0 or 1. EX
>
> SELECT * FROM users WHERE username != 'admin' ORDER BY name LIMIT 16, 20
>
> //My sql statment that says start at row 16 and show 20 rows from there
>
> How can I do this in ORACLE.
>
> I've tried using ROWNUM but it only let's me start w/ row 0 or 1 never
> 2, 16, etc.
>
> This won't work
>
> SELECT * FROM users WHERE rownum < 22 and rownum > 3 and username !=
> 'admin'
>
> Please help.
>
> Thanks
> Sharron
>

It can't be done "in Oracle".
The 1st row "selected' is rownum = 1,
but the WHERE clause insists rownum > 3 so this row is rejected.

Repeat, lather, rinse, repeat.... Received on Sat Jun 07 2003 - 03:49:08 CEST

Original text of this message