5th biggest salary in a db2 databae table.

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
bnr_inbox
Member
Posts: 1
Joined: Sat Nov 14, 2009 7:26 pm

5th biggest salary in a db2 databae table.

Post by bnr_inbox » Fri Nov 20, 2009 9:38 pm

Hi,

I have a table with Emp# and salary as columns for 10K rows.
I want to get the 5th biggest salaried employee(s) in the table.

Could you help me out by providng query.

Thanks,

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Fri Nov 20, 2009 10:17 pm

as your previous classmates have undoubted told you,
you can get an answer for almost anything about IBM MFs here.

as such, if you plan on being in IT longer than your course time,
you have to learn to research.

this question (varying from 2nd to 6th largest/smallest) has been answered about 1000 times.

suggest you search - or even google.

as your last sentence indicated, we are here to help, not do.
what have you found/done that you don't understand?
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

DB2 5TH MAX ROW QUERY

Post by Natarajan » Sat Nov 21, 2009 10:08 am

try using correlated subquery. you will get the answer.

if you dont know, what is correleted subquery.. do let me know.


You need to post this topic in db2 forum .. not in JCL forum.
Natarajan
Chennai

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others