Page 1 of 1

Two quick questions

Posted: Wed Dec 23, 2009 10:20 am
by noah_xumin
Q 1: Let us say I have 2 servers. Server 1 gave me a average_time value and Server 2 gave me another average_time value. How can I make the average number from these 2 servers/values and let the database put the average value into Server 1's average time slot and Server 2's average time slot

Q 2:I have a couple of server_id with the same value. How can I write a PHP/SQL script to sum the server_id number with the same value ?

Thank you so much for your help!

- Noah

Re: Two quick questions

Posted: Wed Dec 23, 2009 5:07 pm
by requinix
What are you talking about?

Re: Two quick questions

Posted: Wed Dec 23, 2009 9:09 pm
by manohoo
I am a little confused about what you are trying to accomplish. Just remember that from a mathematical point of view you can't average averages. Does this make sense?

In other words, if you have these 2 averages, avg1 = 10, and avg2 = 20, you can't safely conclude that the average of the 2 is 15.

You have to know the population of each average, that is:

TotalAvg = (hits1 + hits2 ) / (pop1 + pop2)