Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Want to print 4th maximum salary from emp table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
raviprasath_kp
Warnings : 1

New User


Joined: 20 Feb 2005
Posts: 65
Location: chennai

PostPosted: Thu Jun 07, 2007 10:05 pm    Post subject: Want to print 4th maximum salary from emp table
Reply with quote

hi i want to print 4th maximum salary from emp table

any qurey please sugest me
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jun 07, 2007 11:42 pm    Post subject: Re: 4th max salary
Reply with quote

Wouldn't it be the same technique shown here, with just a difference in the count?

or here in any of these?

http://ibmmainframes.com/viewtopic.php?t=16311
http://ibmmainframes.com/viewtopic.php?t=12789
http://ibmmainframes.com/viewtopic.php?t=7683
http://ibmmainframes.com/viewtopic.php?t=6243
http://ibmmainframes.com/viewtopic.php?t=2931
http://ibmmainframes.com/viewtopic.php?t=2739
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 08, 2007 12:08 am    Post subject:
Reply with quote

Hello,

Quote:
any qurey please sugest me


Sorry to be a grump, but now that you've been here for over 2 years, you would hopefully be familiar with the forum tool that lets you do a search. . . icon_sad.gif
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Fri Jun 08, 2007 11:52 am    Post subject:
Reply with quote

Hope you get the answer from the link http://ibmmainframes.com/viewtopic.php?t=16311 provided by Super K
which is
SELECT MAX(SALARY) FROM EMP_TABLE A WHERE 4=(SELECT COUNT(*) FROM EMP_TABLE B WHERE A.SALARY<=B.SALARY);
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm
No new posts Getting soc4 on internal table in cobol abdulrafi COBOL Programming 13 Fri May 06, 2016 3:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us