Use the AVG aggregate function. I think you really need to take a step back
from what you're doing and spend some time learning basic SQL, because a
huge number of the issues you've been posting about would be immediately
solved if you had an understanding of joins and aggregate functions. There
ar
Select avg(columnname) as whatever from table
..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com
-Original Message-
From: erik tom [mailto:[EMAIL PROTECTED]
Sent: Monday, April 21, 2008 10:01 AM
To: CF-Talk
Subject: Re: output column average using
>I have to point out that this approach is terribly inefficient. Calculations
>like this should be in at the database level using SQL, that's exactly what
>it's supposed to do. Any time you're looping over queries to run more
>queries, or to total things up, it should be a big red flag, because in
I have to point out that this approach is terribly inefficient. Calculations
like this should be in at the database level using SQL, that's exactly what
it's supposed to do. Any time you're looping over queries to run more
queries, or to total things up, it should be a big red flag, because in
almo
>If they're simple numbers and you're feeling lazy,
>#arrayAverage(listToArray(valueList(myQuery.myColumn)))# will do the
>deed, though I don't know about the efficiency. You can just roll up
>a total as you loop through the rows and then divide by row count at
>the end.
>
>cheers,
>barneyb
>
>On
Actually, you don't even need to convert it to a list and back to an
array, Just do this:
#arrayavg(myQuery['myColumn'])#
~Brad
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Friday, April 18, 2008 2:46 PM
To: CF-Talk
Subject: Re: output colum
If they're simple numbers and you're feeling lazy,
#arrayAverage(listToArray(valueList(myQuery.myColumn)))# will do the
deed, though I don't know about the efficiency. You can just roll up
a total as you loop through the rows and then divide by row count at
the end.
cheers,
barneyb
On Fri, Apr 1
7 matches
Mail list logo