Re: Counting results using 2 tables.

2002-12-26 Thread ed
Oops! I guess it doesn't work fine. The query returns 1 as the count for agents that do not have any listings. How can I remedy that? Thanks, Ed > > > SELECT name,COUNT(listings.*) as cnt from agents LEFT OUTER JOIN > > listings ON agents.name=listings.agent GROUP BY name; > > > > IMO, joini

Re: Counting results using 2 tables.

2002-12-26 Thread ed
> SELECT name,COUNT(listings.*) as cnt from agents LEFT OUTER JOIN > listings ON agents.name=listings.agent GROUP BY name; > > IMO, joining by name is a real bad idea. Thanks for the help. The above query provided gives the follwing error. ERROR 1064: You have an error in your SQL syntax near

Re: Counting results using 2 tables.

2002-12-24 Thread Adolfo Bello
On Tue, 2002-12-24 at 12:11, [EMAIL PROTECTED] wrote: > I wish to get a count of records contained in 1 table as compared to the > contents of a different table. What I have is a list of realtors in 1 > table (agents.name) The listings are contained in a different table > (listings) and each can be