Re: ROWNUM between 5 and 30 doesn't work

From: Jusung Yang <JusungYang_at_yahoo.com>
Date: 6 Jun 2003 22:33:43 -0700
Message-ID: <130ba93a.0306062133.229a5ccf_at_posting.google.com>


This is one of them FAQs.

SQL> select c1,rownum rn from tyu;

        C1 RN
---------- ----------

         0          1
         1          2
         2          3

SQL> select * from (select c1,rownum rn from tyu) where rn >1 and rn <3;

        C1 RN
---------- ----------

         1 2

SQL>

  • Jusung Yang

Sharron <sharron_allen_at_raytheon.com> wrote in message news:<3EE118FC.1070908_at_raytheon.com>...
> 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
Received on Sat Jun 07 2003 - 07:33:43 CEST

Original text of this message