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: 4649
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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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