View previous topic :: View next topic
|
Author |
Message |
yadagiri.p
New User
Joined: 01 Sep 2005 Posts: 10 Location: Bangalore
|
|
|
|
Hi all
pls send Nth maximum query in db2. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
yadagiri.p,
This has been a popular post subject. Please search the DB2 forum, you will find your answer.
Dave |
|
Back to top |
|
|
krish_mrt
New User
Joined: 15 Apr 2005 Posts: 12 Location: Chennai
|
|
|
|
Hi...
try this...
Code: |
SELECT DISTINCT F2 FROM T1 T
WHERE <Nth Max. Number> = ( SELECT COUNT(DISTINCT F2) FROM T1 X
WHERE T.F2 < X.F2 )
ORDER BY F2 DESC ;
|
|
|
Back to top |
|
|
|