How to retrieve third row from any table using “rownum” key word ( i am using oracle-10g)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Oracle assigns values to ROWNUM sequentially as rows are produced by the query – thus, the first row fetched gets ROWNUM=1, the second row fetched gets ROWNUM=2, the third row fetched gets ROWNUM=3, etc. Notice – for a row to be assigned ROWNUM=3 two preceding rows MUST be fetched. And this is why your query returns no rows. You’re asking the database for the third row fetched – but rows 1 and 2 have never been fetched.
To demonstrate, try running the following queries:
To work around your problem, try the following:
Share and enjoy.