Solved
Parent child list
Posted on 20040910
hi all,
i have a table with column of category related to other category of other rows  sub category (self join).
A

  
AA AB AC
  
  ACA
 
 
   
 ABA ABB ABC
  
  
   
 ABBA ABCA ABCB

 
AAA AAB
1. Parent category may have none or more sub category, which also may have none or more sub sub category... until n deep (undefine)
2. Sub category must only have one parent category.
Questions:

1. How I'm going to list all child of parent category/sub category using stored proc. to produce result like below:
List all category below AB, will procude result set like this:
AB
ABA

ABB
 ABBA

ABC
ABCA

ABCB
2. How to list all parent category of sub category ABCB
List all parent until root parent of ABCB
A
AB
ABC
if possible i like to have solution in sql statement (tsql, MSSQL, esp for the second question) or visual basic. please, i hope somebody can help me on this.