Using SQL Aggregate Functions Is Efficient

Using SQL Aggregate Functions Is Efficient

All SQL-compliant systems, including Microsoft JET SQL, have a set of functions to return computed results of numeric data stored in a column. All the aggregate functions create effects that could be arrived at through other means, but using the aggregate functions is more efficient. The SUM function, for example, returns the total of all the values in a column. If you have a column called Revenue, the following will create a new record called TotalRevenue:

 SELECT SUM(Revenue) AS TotalRevenue from MyTable

Other aggregate functions available in JET SQL are:

AVG — the average of all values
COUNT — number of records in column
MAX — highest value in the column
MIN — lowest value in the column


Share the Post: