MySQL query... count?
| From: | Tristan dot Pretty at risk dot sungard dot com | Date: | Mon, 01 Mar 2004 10:53:55 +0000 |
| Subject: | MySQL query... count? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-33223@lists.php.net to get a copy of this message | ||
This problem pertains to a system that records all downloads from our
site:
I have a field in my DB, that states which business unit owns the download
that was recorded...
What I need to do for a new report, is say how many downloads were
recorded for each Business unit?
I can select the Business units using Distinct, but hhow can I then count
them?
I've tried:
SELECT DISTINCT(bu)buname, COUNT(buname)bucount FROM $table_name
But it doesn't work.. am I being dumb on this cold Monday morning?
Tris...
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************