MySQL query... count?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
***********************************************************************

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux