Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Counter for children in self-referential table
Message
De
21/08/2006 02:49:29
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Counter for children in self-referential table
Divers
Thread ID:
01147193
Message ID:
01147193
Vues:
63
Just wondering quite recent solution for Thread 1147165
may be altered to be used for self-referential table ( id , parent_id )
select mytable.id,mytable.descript,step1.CountChildren from mytable ;
inner join ;
(select parent_id , count(*) as CountChildren from mytable group by parent_id ) step1 ;
on mytable.id = step1.parent_id 
Statement above gives a syntax error

TIA
Michael
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform