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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-12-12 : 07:28:42
|
| Krishnakumar writes "How to get the row that has Nth Largest value for a column ?Using Cursor is OK .But any other alternative is there?" |
|
|
surendrakalekar
Posting Yak Master
120 Posts |
Posted - 2005-12-12 : 07:41:53
|
| http://www.dotnetspider.com/technology/qa/ViewQuestion.aspx?QuestionId=1995You will find out so many even in this forum.. just searchSurendra |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-12-12 : 07:48:20
|
| Select min(col) from (Select Top N col from yourTable order by col DESC) TMadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-12-12 : 14:39:25
|
"Using Cursor is OK"Oh no its not! [Pantomime season here in the UK!]Variation on Maddy's code:Select TOP 1 MyColfrom ( Select Top N MyCol from yourTable order by col DESC) Torder by col ASC Kristen |
 |
|
|
|
|
|