Aggregate Functions

<< Click to Display Table of Contents >>

Navigation:  SQL Reference > Functions and Operators >

Aggregate Functions

Previous pageReturn to chapter overviewNext page

 

Aggregate functions operate against a collection of values, but return a single value.

Absolute Database supports the following aggregate functions:

Function

Description

Example

AVG

Returns the average value of a numeric column / expression

SELECT AVG(commission_rate) FROM sales_rep_tbl

COUNT

Returns the number of rows (without a NULL value) of a column / expression

SELECT COUNT(FirstName) FROM employee

COUNT(*)

Returns the number of selected rows

SELECT COUNT(*) FROM employee

MAX

Returns the highest value of a numeric or character column / expression

SELECT MAX(commission_rate) FROM sales_rep_tbl

MIN

Returns the lowest value of a numeric or character column

SELECT MIN(FirstName) FROM employee

SUM

Returns the total sum of a column

SELECT SUM(ytd_sales) FROM sales_rep_tbl

__________________________
Absolute SQL Reference - 05 January 2023, Niels Knabe