?
Solved

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

Posted on 2009-04-01
3
Medium Priority
?
893 Views
Last Modified: 2013-12-19
how to get 2nd record in the records returned in Oracle sql
0
Comment
Question by:umesh4exp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 400 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 1600 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 32

Expert Comment

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

800 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