In a one to many relationship between a parent and child table, what is the lightest way to count() the child table and return the parent description in one SQL statement?
Like:
TableParent = SomeID I, description C(50)
TableChild = pk I, SomeID I, OtherTablePK I)
My answer is this:
Select count(tablechild.someid) as itemcount, tableparent.description ;
from tablechild ;
left outer join tableparent ;
on tablechild.SomeID=tableparent.SomeID ;
group by tablechild.someid,tableparent.description
But it seems that I'm missing a "lighter" way to do this... am I?
Brandon Harker
Sebae Data Solutions