Yeah, I just figured it out ten minutes ago, one of those stupid little
oversites on my part.

-----Original Message-----
From: Martin Jespersen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 02, 2006 3:40 PM
To: John Meyer
Cc: mysql@lists.mysql.com
Subject: Re: Doing a join

select g.GROUP_NAME, count(mg.MEM_ID) as NUMBER_OF_MEMBERS from GROUPS g
left join MEM_GRO mg using(GRO_ID) group by g.GRO_ID


John Meyer wrote:
> I have two tables:
> 
> 
> MEMBERS:
> MEM_ID
> ...
> 
> GROUPS:
> GRO_ID:
> ...
> 
> And one joiner
> 
> MEM_GRO:
> MEM_ID, GRO_ID
> 
> 
> I want to print out a list like this
> 
> GROUP_NAME, NUMBER_OF_MEMBERS
> 
> Even when the number of members is 0, how do I do that?
> 
> 
> 



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

Reply via email to