MySQL Forums
Forum List  »  Quality Assurance

Re: is this a bug?
Posted by: Felix Geerinckx
Date: April 11, 2007 02:56AM

Yuri Niyazov Wrote:


> OK. So, what would be the right way of doing this?
> How about this: I create a view and have it calculate the averages only it. I select from that
> view and also calculate the values that depend on the averages (the product and the squares of averages).

That should do it. Or you could do the aggregates in an inner subquery, as in
SELECT tfoo.c, tfoo.themax - tfoo.themin
FROM (SELECT c, MIN(i) themin, MAX(i) themax FROM foo GROUP BY c) AS tfoo

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Views
Written By
Posted
4346
April 10, 2007 01:18AM
2833
April 10, 2007 04:08AM
2933
April 10, 2007 12:05PM
Re: is this a bug?
3008
April 11, 2007 02:56AM
4227
April 16, 2007 09:00AM


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.