View Single Post
Old 03-06-2004, 09:59 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
SQL Query Help Please

3 tables:

Articles ( ArticleID, ArticleTitle, ArticleText )
Category ( CatID, CatName )
ArtCat ( ArticleID, CatID )

the point here is to be able to be able to assign multiple categories for an article.

well, i want to make a list of categories with the number of articles in that category.

this query works, but it does not return the categories if there are no articles in them.
Code:
select Category.CatID,Category.CatName,count(ArtCat.ArticleID) 
from Category,ArtCat where Category.CatID=ArtCat.CatID group by Category.CatID
how can i return categories that don't have articles assigned to them?
__________________
Mike
sde is offline   Reply With Quote