The reason is that rownum is not an attribute of the table but is an element of the result set. You will never get results where the first value for rownum is greater than 1, since the query returns the first row and its rownum is 1 but doesn't meet the where clause so it returns the second row and its rownum is also 1, etc.
For example, none of the following queries will return results:
Select * from table where rownum =2;
Select * from table where rownum >1;
Select * from table where rownum between 2 <or greater> and <anything>;
To get rows between 11 and 20, you need to do the following:
Select * from table where rownum < 21
minus
Select * from table where rownum <11;
Main Topics
Browse All Topics





by: amoranPosted on 2005-05-03 at 09:24:31ID: 13919342
ok this is odd
when i change my second sql to
1 and 20
i get 20 results!