Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 to find second max no in table

Author  Topic 

shaggy
Posting Yak Master

248 Posts

Posted - 2007-07-06 : 05:52:36
Dear all,

i want to find the second max no from a column can anyone help me in this

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-07-06 : 06:01:16
You would have got the answer if you would have spent just 5 mins searching the forums:

[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36066[/url]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

shaggy
Posting Yak Master

248 Posts

Posted - 2007-07-06 : 06:12:09
thank u harsh i got it
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-07-06 : 06:13:49
My favourite

Select min(no) as no from
(
select top 2 no from table order by no desc
) T

But I wonder why people target only the second maximum

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -