why don't you calculate the stats every time someone inserts new stats...
you could have a column in your table for the average of the stats you
want.. that way when you want to call them back up all you have to do is get
that one column and save your cpu all that processing power... that's my
thought.. :)

jay

----- Original Message -----
From: "Jeff Lewis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 30, 2001 12:11 PM
Subject: [PHP] Large Calculations


> I have a mySQL database holding baseball stats and I want to calculate
> rankings on these players.  Now I'd obviously want this to be as fast as
> possible since I go through about 600 players but where is it best to make
> them?  In the SQL command itself or in PHP?
>
> players need to have at least 100 at bats for this formula to work for
them.
> There are  6 steps.
>
> 1. batting average x .05
> 2. doubles + triples + HR divided by at bats
> 3. runs scored divided by at bats
> 4. rbi's divided by at bats
> 5. stolen bases divided by at bats
> next add up the 5 totals then multiply that total by 200.   It's a bse 100
> system. a rating over 100 is very good.
>
> Jeff
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to