Solved

how to get 2nd record in the records returned in Oracle

Posted on 2009-04-01
3
880 Views
Last Modified: 2013-12-19
how to get 2nd record in the records returned in Oracle sql
0
Comment
Question by:umesh4exp
3 Comments
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
ID: 24047177
you will have to clarify a bit more, but it shall be along these lines:
select t.*
 from ( select d.*, row_number() over ( order by somefield ) r 
          from data_table d
      ) t
 where t.r = 2
         

Open in new window

0
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 400 total points
ID: 24047701
You can even try :

select * from (
select d.*, rownum record_number  from your_tables d )
where record_number = 2
0
 
LVL 31

Expert Comment

by:awking00
ID: 24051380
What determines "2nd" record and what is the query for which you want it?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now