Skip to main content

Aggregate Functions in SQL

Aggregate Functions

Aggregate Functions : An aggregate function performs a calculation on a set of values, and returns a single value. Except for COUNT, aggregate functions ignore null values. Aggregate functions are often used with the GROUP BY clause of the SELECT statement. aggregate functions return the same value each time that they are called, when called with a specific set of input values.

The following are the commonly used SQL aggregate functions:
  • AVG() – returns the average of a set.
  • COUNT() – returns the number of items in a set.
  • MAX() – returns the maximum value in a set.
  • MIN() – returns the minimum value in a set.
  • SUM() – returns the sum of all or distinct values in a set.

Comments