Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lighter Count Child-Parent?
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01382205
Message ID:
01382217
Views:
37
In that example I don't care about the parents without children, but I guess the lighter way to do that is to add the having clause like:
Select count(tablechild.someid) as itemcount, tableparent.description ;
	from tableparent ;
		left outer join tablechild ;
			on tablechild.someid = tableparent.someid ;
	group by tableparent.someid,tableparent.description
                having itemcount>0
Brandon Harker
Sebae Data Solutions
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform