Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to SELECT exactely the 3rd row of a result table set ?

pstein-JavaNetMay 25 2007 — edited May 25 2007
Assume I perform a SELECT statement with some WHERE clauses.

The resulting temporary result table set contains now 30 records.
Out of these 30 records I would like to get only the 3rd row.

Ok, I could do this be a cursor and walk over the first 2 rows. But is there a short way? I am thinking of a statement like

SELECT * FROM .... WHERE .... SKIP 2

If there is no 3rd rows an exception NO_ROWS_FOUND should be returned.

Additionally is there a way to return only the 3rd LAST rows of a result table set ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2007
Added on May 25 2007
5 comments
789 views