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 |
|
salmonraju
Yak Posting Veteran
54 Posts |
Posted - 2007-08-20 : 08:43:48
|
| Hi i am writing a query, That gives "sum of top 10 salaries"My Table is ID Dept SALARY 1 xx 1000 2 yy 2000 3 zz 3000 . . . . 100 aac 10000I want a query for Sum of Top 10 salararies |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2007-08-20 : 08:51:28
|
| [code]select sum(a.Salary) from (select top 10 Salary from dbo.SalaryTableorder by Salary desc) a[/code][Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
salmonraju
Yak Posting Veteran
54 Posts |
Posted - 2007-08-20 : 08:55:00
|
| Thank You,Its working |
 |
|
|
|
|
|