ROWNUM is a pseudocolumn.As values are read into thecache they are assigned a value.The numbers are dynamic they change for every query.Thus the exact same rowcould have a different rownum depending on the number of rows that were read into the cache.
select rownum, columna, columnb from test;
ROWNUM COLUMNACOLUM
---------- ---------- -----
1
1 a
2
2 b
3
3 c<-------- rownum = 3
4
4 d
5
5 e
5 rows selected.
select rownum, columna, columnb from test where columna = 3;
ROWNUM COLUMNACOLUM
---------- ---------- -----
1
3 c<--------- rownum = 1
1 row selected.
The rownum is different for the same row depending on the other values that are returned with the query.
In any event, there must be rownum of 1 returned before the 2 can be returned.Querying the values with therownum= value (i.e. 3) is an invalid statement, it will always return with a 'No Rows Selected' message.
|