Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: rownum
db2group88_at_yahoo.com wrote:
> hi, we are using oracle 10g, here is the wierd thing i don't
> understand, i do "select rownum, name from admin.test", i can see the
> result value of rownum is 1 and 2, and both columns has data in it, but
> when i do "select name from admin.test where rownum=2", i can't get the
> data back, i do "select name from admin.test where rownum=1", the data
> is returned, can someone help me? thanks
This is because you have no idea what ROWNUM is.
ROWNUM is not the number of the row in the table. It is the number of the rows returned to you by your query. Since there is not ROWNUM = 1 there can not be a 2 or a 43 or a 1000.
Go to http://www.psoug.org
click on Morgan's Library
click on Pseudocolumns
Run the demo
Also visit http://tahiti.oracle.com and look up PSEUDOCOLUMN.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Mon Jan 03 2005 - 19:00:03 CST