On 20 Mar 2006, at 15:17, Jay Sprenkle wrote:

On 3/20/06, Ian M. Jones <[EMAIL PROTECTED]> wrote:
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

Is your group by summarizing your results away?


Nope, don't think so. If I try this even simpler example I still don't get results for the other two Categories...

select xcat.Category, xc.CaseID as NumCases
from Category As xcat
left outer join Cases as xc on xcat.CategoryID = xc.CategoryID
where xc.CaseID in (3145)
;

Even if I strip it down further and take out the "in", I still only get the one Category back when I'd expect all three:

select xcat.Category
from Category As xcat
left outer join Cases as xc on xcat.CategoryID = xc.CategoryID
where xc.CaseID = 3145
;

Is there another way of specifying an outer join in SQLite?
--
Ian M. Jones
___________________________________
IMiJ Software
http://www.imijsoft.com
http://www.ianmjones.net (blog)


Reply via email to