Ian M. Jones <ian-if8tMcB8Y5RWk0Htik3J/[EMAIL PROTECTED]> wrote:
I'm trying to get a count of all Cases for each Category, with an
outer join to Cases so that I always get a record for each Category
regardless of whether there are any Cases with that Category or not.
select xcat.Category, count(xc.CaseID) as NumCases
from Category as xcat
left join Cases as xc on xcat.CategoryID = xc.CategoryID
where xc.CaseID in (3145)
group by xcat.Category
order by xcat.Category
;
How many cases with an ID of 3145 do you expect to find? In other words,
what's the purpose of the 'where' clause in your query?
Igor Tandetnik