Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Beginner
Feb 10, 1999

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

Steve Renaker
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date