View previous topic :: View next topic |
Author |
Message |
skrishnan Beginner
Joined: 26 May 2003 Posts: 2 Topics: 1
|
Posted: Mon May 26, 2003 8:08 am Post subject: Aggregrate functions |
|
|
How can i get the second max/min valued column from a table |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon May 26, 2003 9:20 am Post subject: |
|
|
Skrishnan,
For second Max:
Code: |
SELECT MAX(COLA) FROM TABLENAME WHERE COLA < (SELECT MAX(COLA) FROM
TABLENAME) ;
|
For second Min:
Code: |
SELECT MIN(COLA) FROM TABLENAME WHERE COLA > (SELECT MIN(COLA) FROM
TABLENAME) ;
|
Hope this helps...
cheers
kolusu |
|
Back to top |
|
 |
skrishnan Beginner
Joined: 26 May 2003 Posts: 2 Topics: 1
|
Posted: Mon May 26, 2003 11:12 pm Post subject: |
|
|
Thanks a lot for the reply. |
|
Back to top |
|
 |
|
|