Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counter for children in self-referential table
Message
 
 
To
21/08/2006 02:49:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01147193
Message ID:
01147235
Views:
18
The solution you're refering to works in VFP9 only. So does your query.

>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
>
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform