Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> ROWNUM, order by
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
![]() |
![]() |