RE: [PHP] Feeling a bit brain dead, please help in maths: averages
| From: | Craig Lonsbury | Date: | Wed, 17 Sep 2003 21:17:45 +0000 |
| Subject: | RE: [PHP] Feeling a bit brain dead, please help in maths: averages | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162930@lists.php.net to get a copy of this message | ||
off the top of my head:
SELECT AVG(age), SUM(salTotal)
FROM blah
WHERE section = 3
i'm not sure if you can use the 2 functions in the same query,
you might have to break it into 2 queries.
Craig
-----Original Message-----
From: Ryan A [mailto:ryan@coinpass.com]
Sent: Wednesday, September 17, 2003 3:08 PM
To: php-general@lists.php.net
Subject: [PHP] Feeling a bit brain dead, please help in maths: averages
Hey,
Been working a bit too much i guess so am feeling braindead...
I have a couple of records in the database, i am doing a: "select
age,salTotal from blah where section=3"
this is getting me a list of records, how do i calculate the average age and
salary total (salTotal) to display in my php page?
Cheers,
-Ryan A
We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php