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, 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 '*) as cnt from > agents LEFT OUTER JOIN listings ON agents.name=listings.agent ' at line > 1 > > If I leave off the (listings.*) and make it just (*) it works just fine. > > Ed --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php