I totally appreciate the extra effort on this one!
Just so you know, the results come back as two records
per client. Like this:
| ClientName | Status | Count |
| Steve | 2 | 25 |
| Steve | 3 | 83 |
| Gary | 2 | 12 |
| Gary | 3 | 33 |
This is close enough to the solution I was looking for
that I can proceed from here!
Thanks a million!
>OK, this time tested :)
>SELECT Clients.ClientName, Ratings.Status, Count(*)
FROM Clients LEFT
>Ratings ON Clients.ID = Ratings.ClientID
>GROUP BY ClientName, Ratings.Status
>HAVING Ratings.Status = 2 OR Ratings.Status = 3
>Software Engineer / Trainer
>----- Original Message -----
>From: "Peter Vervoorn" <[EMAIL PROTECTED]>
>To: "php-db list" <[EMAIL PROTECTED]>
>Sent: Thursday, February 14, 2002 9:36 AM
>Subject: Re: [PHP-DB] counting multiple columns based
>> This should do the trick (untested):
>> SELECT ClientName, Count(*) FROM Clients LEFT JOIN
>> GROUP BY ClientName
>> HAVING Ratings.Status = 2 OR Ratings.Status = 3
>> Software Engineer / Trainer
>> Vervoorn IT
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php