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!

find Nth row in a table

2652054Apr 15 2016 — edited Apr 18 2016

Hi,

I had to find 5th incident type id from cs_incident_types_tl table. So I was googling for a SQL query to find Nth row in an Oracle table

and found the below example

SELECT a.incident_type_id

FROM cs_incident_types_tl A

WHERE 5 = (SELECT COUNT (b.incident_type_id)

            FROM cs_incident_types_tl B

            WHERE a.incident_type_id<=b.incident_type_id)

But I am unable to understand how the query is functioning.

So i would appreciate any help from you experts if you could explain the execution/functioning of this query.

This post has been answered by Frank Kulash on Apr 15 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2016
Added on Apr 15 2016
13 comments
679 views