On Monday 01 March 2004 18:53, [EMAIL PROTECTED] wrote:

> 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?

Don't use DISTINCT, use GROUP BY.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
One thought driven home is better than three left on base.
*/

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

Reply via email to