Hi friends,
Ques : What are Aggregate functions? Explain Aggregate functions in SQL SERVER 2008 with example.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Mar 30, 2012, 12:01 AM
SQL Aggregate functions return a single value, using values in a table column.
following are good article on Aggregate functions in SQL.
http://www.mssqltips.com/sqlservertip/1221/sql-server-tsql-aggregate-functions/
http://msdn.microsoft.com/en-us/library/ms173454%28v=sql.110%29.aspx
hope this help.
SenthilkumarPosted Mar 29, 2012, 10:13 AM
Aggregate function performs calculation of the columns and returns single result. It is very useful to implement the business logic. It is used to get the maximum value of the column or minimum value of the column, etc..,
There are several types of aggregate functions.
For example,
COUNT - SELECT COUNT(ProductID) FROM Products WHERE ProductType = 'Consumer'
MAX - SELECT MAX(Subject1) FROM Marks WHERE sYear = 2010
MIN - SELECT MIN(Subject5) FROM Marks WHERE sYear = 2011
SUM - SELECT SUM(Amount) FROM Sales WHERE ProductType='Sports'
Similarly you can implement other aggregate functions.
You can get more details with example in
http://msdn.microsoft.com/en-us/library/ms173454(v=sql.110).aspx
Satyapriya NayakPosted Mar 29, 2012, 8:38 AM
Aggregate functions perform a calculation on a set of values and return a single value. With the exception of COUNT, aggregate functions ignore null values. Aggregate functions are often used with the GROUP BY clause of the SELECT statement.
Please refer the below link
http://msdn.microsoft.com/en-us/library/aa258901%28v=sql.80%29.aspx
http://databases.about.com/od/sql/l/aaaggregate1.htm
Thanks