Aggregate Functions in SQL SERVER 2008
What are Aggregate functions? Explain Aggregate functions in SQL SERVER 2008 with example.
Aggregate functions are applied to a group of data values from a column. Aggregate functions always return a single value.
SQL SERVER 2008 / Transact-SQL supports following aggregate functions:
AVG: Calculates the arithmetic mean (average) of the data values contained within a column. The column must contain numeric values.
MAX and MIN: Calculate the maximum and minimum data value of the column, respectively. The column can contain numeric, string, and date/time values.
SUM: Calculates the total of all data values in a column. The column must contain numeric values.
COUNT: Calculates the number of (non-null) data values in a column. The only aggregate function not being applied to columns is COUNT(*). This function returns the number of rows (whether or not particular columns have NULL values).
COUNT_BIG: New and Analogous to COUNT, the only difference being that COUNT_BIG returns a value of the BIGINT data type.
Aggregate function Example:
SELECT ProjectName, SUM(budget) TotalBudget FROM Project_Tbl GROUP BY ProjectName;
More Questions? Ask in comments.
thanks for sharing ur knowledge
ReplyDeletehttp://soft-engineering.blogspot.com/
what is function in sql server 2008??
ReplyDeletenice answer
ReplyDeleteNice questions
ReplyDeletehttp://www.interviewqsn.com
http://www.getproductprice.com
I have found another nice post over the internet which is also having a wonderful explanation on sql server aggregate function or sql function. For more details of that post please check out this link...
ReplyDeletehttp://mindstick.com/Articles/485e31f2-613e-4758-8d4f-5a5d74c3a2ed/?%E2%80%98SELECT%E2%80%99%20command%20with%20Aggregate%20Function
Thanks
Nice information you've provided in this blog. Very informative blog. I really enjoyed and got useful information.
ReplyDeleteI do nоt even know how I enԁed uρ here,
ReplyDeletebut I thought thіѕ post ωas great. I don't know who you are but definitely you're going to a fаmous blogger
іf you are not alrеady ;) Cheers!
Here is my homepage Visit This Website
Hey!
ReplyDeleteWhat a commendable work you have done, with simplest of language.I'm truly enjoying the design and layout of your site. I can’t resist myself to leave a comment and trust me it’s hard to impress me.
Vachel
PHP Development Chicago
.NET Development Chicago
Chicago Development Team
cmscentral.net
Thank You! For sharing such a great article, It’s been an amazing article. It provides lot’s of information, I really enjoyed to read this, I hope, I will get these kinds of information on a regular basis from your side.
ReplyDeleteApps Development Companiesin Ghana
This article is very insightful and informative. The practical examples added extra value to the topic. Thanks for sharing this useful post.workday hcm course
ReplyDeleteInsightful article! MuleSoft training is ideal for mastering API development, integration flows, and connecting modern applications efficiently.mulesoft training
ReplyDelete