View Single Post
Old 03-07-2004, 05:20 AM   #2 (permalink)
sdeming
Code Monkey
 
Join Date: Jul 2002
Location: Michigan
Posts: 85
sdeming is on a distinguished road
You want to use an OUTER join.

I'm pretty sure the syntax in MySQL goes like this:
Code:
SELECT Category.CatID,
       Category.CatName,
       count(ArtCat.ArticleID) 
  FROM Category,ArtCat 
  LEFT JOIN ArtCat ON Category.CatID = ArtCat.CatID 
 GROUP BY Category.CatID
I'm not 100% sure that's right, but it's something like that. Unfortunately OUTER JOIN syntax is different for different RDBMS' so I lose track since I don't work in MySQL much.
__________________
Scott
B4 09 BA 09 01 CD 21 CD 20 53 63 6F 74 74 24
sdeming is offline   Reply With Quote