Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counter for children in self-referential table
Message
From
21/08/2006 02:49:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Counter for children in self-referential table
Miscellaneous
Thread ID:
01147193
Message ID:
01147193
Views:
65
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
Next
Reply
Map
View

Click here to load this message in the networking platform