JetSQL » Functions

When it is desired to summarize data within a table, an aggregate query can be created. An aggregate query is an SQL statement that uses an aggregate function to gather information from multiple rows. An aggregate function is a function that performs calculations on a column in a set of rows. When this query is executed, a result set with the summary information is produced in a single row.

An example of when an aggregate function could be used would be to produce a total value of an inventory. This would be accomplished with the SUM function being applied to a price column.

The following aggregate functions are available:

Aggregate FunctionDescription
AVGAverage of values in a column.
COUNTCounts how many rows.
FIRSTReturns the value of the first record in a field.
LASTReturns the value of the last record in a field.
MAXMaximum value in a column.
MINMinimum value in a column.
STDEVSample standard deviation of the values in a column.
STDEVPStandard deviation of the values in a column.
SUMAdds the values in a column.
VARSample variance of the values in a column.
VARPVariance of the values in a column.