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 - 2002-06-26 : 09:52:39
|
| srinivas ashok writes "please get me a code on how to get the top 10 persons salary (a correlated sub query)" |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-06-26 : 10:15:08
|
| select top 10 personssalary from salarytable order by personsalary descIf ya want anything more, you'll have to post the ddl for your tables (the create statement)-----------------------Take my advice, I dare ya |
 |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2002-06-26 : 11:59:27
|
| Sounds like you're after a derived table, as in:SELECT TOP 10 PersonsFROM( SELECT...FROM ...WHERE... ) as SubTblORDER BY ... |
 |
|
|
|
|
|