How to query a tree# Database - 数据库
n*w
1 楼
In MS SQL 7, how to query a tree,
i.e. if I have a table as follows:
ID--CONTENT--PARENTID
1--'XX'--0
2--'XX'--0
3--'XX'--0
4--'YY'--0
5--'XX'--2
6--'XX'--2
7--'WW'--5
...
How to use SQL to query either the whole structure of the tree or one whole branch?
Thx
i.e. if I have a table as follows:
ID--CONTENT--PARENTID
1--'XX'--0
2--'XX'--0
3--'XX'--0
4--'YY'--0
5--'XX'--2
6--'XX'--2
7--'WW'--5
...
How to use SQL to query either the whole structure of the tree or one whole branch?
Thx