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
 Transact-SQL (2000)
 Select second highest score from the table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-05-09 : 08:25:24
Harmeet writes "Hi,
I have a Table
Name Scores
User1 101
User2 12
User3 203
User4 100

Query to find User having second highest score(i.e in this scenario scores=101)

thx"

RM
Yak Posting Veteran

65 Posts

Posted - 2005-05-09 : 09:15:08
Select Top 1 *
from myTable
Where Score < (Select Max(Score)
from myTable)
Order by score desc


http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49355
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-09 : 09:21:36
http://sqlteam.com/forums/topic.asp?TOPIC_ID=49355

Madhivanan

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

- Advertisement -