View previous topic :: View next topic
|
Author |
Message |
ideas
New User
Joined: 25 May 2005 Posts: 52 Location: India
|
|
|
|
Hi All,
my query is how to Obtain Second maximum value from any table..
thnx. |
|
Back to top |
|
|
paru
New User
Joined: 24 Jun 2005 Posts: 9 Location: INDIA
|
|
|
|
I can give you the logic if not the exact query to get this result.The answer you are searching is a subquery.Suppose you have to find the second maximum salary from EMPL table.
Try this :
SELECT MAX(SALARY) FROM EMPL WHERE
SALARY <(SELECT MAX(SALARY) FROM EMPL)
hope this helped!
Regards,
Paru. |
|
Back to top |
|
|
ideas
New User
Joined: 25 May 2005 Posts: 52 Location: India
|
|
|
|
hey paru!! thanks. I tried and it worked fine.
|
|
Back to top |
|
|
|