Aggregate function

Applies to: sql

An aggregate function reduces many rows to a single value: COUNT, SUM, AVG, MIN, MAX. Used alone it summarizes the whole result; with GROUP BY it summarizes each group.

SELECT AVG(price) AS avg_price, MAX(price) AS top
FROM   products;

See also: group-by