Home » SQL & PL/SQL » SQL & PL/SQL » ROWNUM
ROWNUM [message #211540] Fri, 29 December 2006 05:20 Go to next message
pavan_034
Messages: 16
Registered: October 2006
Junior Member
I HAVE A DOUBT REGARDING THIS ROWNUM IN SQL.
IF YOU WANT TO RETRIEVE DATA FROM THE FIRST ROW YOU CAN WRITE THE FOLLOWING SQL QUERY:

SELECT * FROM EMP WHERE ROWNUM=1;

BUT IF YOU WANT TO RETRIEVE DATA FROM ROWS OTHER THAN FIRST ROW USING SAME QUERY IT RETURNS NOTHING.WHY SO?
FOLLOWING QUERY RETURNS 'no rows selected'
SELECT * FROM EMP WHERE ROWNUM=2;

Re: ROWNUM [message #211549 is a reply to message #211540] Fri, 29 December 2006 05:59 Go to previous messageGo to next message
gbarbisan
Messages: 67
Registered: August 2006
Location: Treviso - Italy
Member
Thanks to T. Kyte:

here

Re: ROWNUM [message #211569 is a reply to message #211540] Fri, 29 December 2006 09:18 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Please note: your Caps Lock is on.

Just in case you didn't notice.
Re: ROWNUM [message #211598 is a reply to message #211540] Fri, 29 December 2006 15:45 Go to previous messageGo to next message
oraclenub2006
Messages: 56
Registered: December 2006
Location: new york
Member
<= 1 will give exactly one row provided the row exists. And so on... <=2 2 rows...
Re: ROWNUM [message #211749 is a reply to message #211598] Tue, 02 January 2007 02:02 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Search and you will find...

MHE
Previous Topic: Conflict between versions of oracle
Next Topic: How to call a function(returning a number) inside an oracle package from vb.net ?
Goto Forum:
  


Current Time: Mon Dec 05 07:13:46 CST 2016

Total time taken to generate the page: 0.25442 seconds