Aggregate Functions
Learn about SQL functions that take multiple values as input.
We'll cover the following...
We'll cover the following...
An aggregate function is a function that takes in multiple values and returns a single value. It can be viewed as a function that performs an operation over the values of multiple rows.
In T-SQL, we have these aggregate functions:
AVG(): Returns the average of supplied valuesCOUNT(): Returns the number of rowsMIN(): Returns the minimum valueMAX(): Returns the maximum valueSUM(): Returns the sum
As an argument, all aggregate functions take an expression that returns a range of values. Often, the expression is the name of the column over the values of which we want to perform the operation:
SELECT ...