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:
01382218
Vues:
28
No, just use INNER JOIN.

>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 ;
		join tablechild ;
>			on tablechild.someid = tableparent.someid ;
>	group by tableparent.someid,tableparent.description
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform