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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Finding second highest value

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-24 : 09:13:55
Ric writes "I actually saw the answer to this question some time ago but cannot remember where and now I need it!

Using SQL Server 7 and W2K
I want to find out the second highest value in the resultset. Example: If I select the age column from a table:
select max(studentage) from student will give me the highest age. What if I want the second (or third, or fourth...) highest?

It can be done using a temp table or a cursor but the solution I saw did not do this."
   

- Advertisement -