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 -> ROWNUM, order by

ROWNUM, order by

From: Sean Hull <shull_at_panix.com>
Date: Mon, 11 May 1998 16:32:54 -0400
Message-ID: <Pine.SUN.3.94.980511162720.26628C-100000@panix2.panix.com>

Hello all:

I would like to do this:

select	*
from	mytable
where	rownum > 9
and 	rownum < 16
order	by c1;

I know I have to create a view because the rownum is assigned before the order by clause is hit.

create or replace view myview as

select	*
from	mytable
group	by c1;

But then only this works:

select * from myview where rownum < 10;

If I want rows 10-15 as above and I do:

select * from myview where rownum > 9 and rownum < 16;

I always get "no rows selected". WHY? I tried

select rownum,c1,c2 from myview;

and everything looks ok. Also, this all seems reasonable since this works:

select * from myview where c1 > 10 and c1 < 20;

What gives?

Sean Received on Mon May 11 1998 - 15:32:54 CDT

Original text of this message

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