Thank you Harald. That's exactly what I was looking for.
-Andy.

On Monday 26 April 2004 05:37 am, Harald Fuchs wrote:
> In article <[EMAIL PROTECTED]>,
>
> If you're sure that the people and things entries for one place are
> distinct, you can use, well, count(distinct):
>
>   SELECT pl.name AS 'Setting Name',
>          count(distinct pp.name) AS '#users',
>          count(distinct th.name) AS '#accounts'
>   FROM places pl
>   LEFT JOIN people pp ON pp.placeid = pl.placeid
>   LEFT JOIN things th ON th.placeid = pl.placeid
>   GROUP BY pl.name


    


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to