$result = mysql_query("select avg(tbl1.age) as avg1, avg(tbl2.age) as avg2
from tbl1, tbl2");
$r = mysql_fetch_array($result);
$avg = ($r["avg1"] + $r["avg2"]) / 2;

"Jeff Lewis" <[EMAIL PROTECTED]> wrote in message
Is it possible to get the average of two tables.  I have an age column in
two tables.  I can get the age average for one table both can the average of
both tables be found in one statement?   One table is for hitters, the other
for pitchers.


PHP General Mailing List (
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