Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lighter Count Child-Parent?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01382205
Message ID:
01382217
Vues:
35
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform