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

nth maximum of a column in a db2 table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rolen
Warnings : 1

New User


Joined: 26 Mar 2005
Posts: 6

PostPosted: Sat Apr 16, 2005 4:13 pm
Reply with quote

hi,
cananybosy give me the logic for finding the nth maximum of a column in a DB2 TABLE. if yes, plz write the select clause statement.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Apr 27, 2005 2:01 pm
Reply with quote

Check this earlier post :

http://www.ibmmainframes.com/viewtopic.php?t=1472&highlight=maximum

Regards,

Priyesh.
Back to top
View user's profile Send private message
nrsmca

New User


Joined: 25 May 2005
Posts: 14

PostPosted: Fri Jun 10, 2005 2:42 pm
Reply with quote

Hi use this one...

SELECT a.SALARY FROM EMPTABLE a WHERE N = (SELECT COUNT(*) FROM EMPTABLE b WHERE b.SALARY >= a.SALARY) ;

It runs perfect.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts count contained values of several col... DB2 5
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts Extract ISPF table column headings CLIST & REXX 2
No new posts Unload and Load ISPF Table TSO/ISPF 4
Search our Forums:


Back to Top