SELECT tableA.*, COUNT(*) AS Tot FROM tableB LEFT OUTER JOIN tableA ON tableA.uid=tableB.uid GROUP BY tableA.uid
Regards, Jerry Schwartz The Infoshop by Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 www.the-infoshop.com www.giiexpress.com www.etudes-marche.com > -----Original Message----- > From: spacemarc [mailto:[EMAIL PROTECTED] > Sent: Friday, June 08, 2007 5:13 AM > To: MySQL > Subject: Select and COUNT > > Hi all, > I have this query: > > SELECT tableA.*, COUNT(*) AS Tot > FROM tableB > LEFT JOIN tableA ON tableA.uid=tableB.uid > GROUP BY tableA.uid > > This query shows only the users (tableA) that are in tableB with at > least 1 record (like total) but not the users that have 0 record. > > How can I obtain all users, also those with 0 record?? > > Thanks in advance > > > > > -- > Scripts: http://www.spacemarc.it > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]