MySQL Forums
Forum List  »  Newbie

Re: formulas
Posted by: Jay Pipes
Date: August 11, 2005 07:27PM

Michael Asbridge wrote:
> But does MySQL have functionality that I can
> configure/design so that when we add the row, the
> db can average some of the row values and
> calculate and insert an average to the average
> field/attribute?

Have you looked at the AVG() function?

http://dev.mysql.com/doc/mysql/en/group-by-functions.html

> I am thinking: are there formulas that can be
> applied in MySQL or stored procedures for inserts
> that will calc and insert the average field
> value?

Don't store calculated fields, unless you have a *very* good reason to do so. Use the agregate functions to get group totals and averages.

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Written By
Posted
August 11, 2005 04:06PM
Re: formulas
August 11, 2005 07:27PM
August 12, 2005 01:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.