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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Mar 29, 2012, 4:38 AM EDT
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
SenthilkumarRank #387 · 6.5K reputationPosted Mar 29, 2012, 6:13 AM EDT
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
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 29, 2012, 8:01 PM EDT
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.