SQL Server 2005: Aggregate Functions

Aggregate functions (e.g. AVG, MIN, MAX, COUNT, etc.) can be in a SELECT statement without the GROUP BY clause.  Without the GROUP BY clause in the SELECT statement will apply the aggregate function to the entire result set.

Also all aggregate functions, except for COUNT(*), ignore NULLs.  So you need to be sure that when you use an aggregate function on a column, you want any NULL values in your column to be excluded in the aggregation, meaning they will not be included in the function.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s