IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Want to print 4th maximum salary from emp table


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Jun 07, 2007 11:42 pm
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?

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

Moderator Emeritus


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

PostPosted: Fri Jun 08, 2007 12:08 am
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
Reply with quote

Hope you get the answer from the link 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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top