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 2005 Forums
 Transact-SQL (2005)
 Select an average

Author  Topic 

sfjtraps
Yak Posting Veteran

65 Posts

Posted - 2009-02-25 : 18:09:41
Does anyone know how to select numbers and return the average of the numbers?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-25 : 18:12:51
SELECT AVG(Numbers)
FROM YourTable

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sfjtraps
Yak Posting Veteran

65 Posts

Posted - 2009-02-25 : 18:32:42
Will the following select an average of number, subtract the average from 1, and then multiply the result by the SUM of number2.

SELECT ((1 - AVG(number))*SUM(number2)) AS Something
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-25 : 18:34:00
Did you try it?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -