|
|
| Author |
Message |
rolen Warnings : 1 New User
Joined: 26 Mar 2005 Posts: 6
|
|
|
|
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 |
|
 |
References
|
Posted: Sat Apr 16, 2005 4:13 pm Post subject: Re: nth maximum of a column in a db2 table |
 |
|
|
 |
priyesh.agrawal
Global Moderator
Joined: 28 Mar 2005 Posts: 1512 Location: Chicago, IL
|
|
| Back to top |
|
 |
nrsmca
New User
Joined: 25 May 2005 Posts: 14
|
|
|
|
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 |
|
 |
|
|