-2
我有類似下面有三列ID,parentId的名稱和SQL表。我必須表明它在樹觀點:
id parentid name
1 NULL outlook
2 1 overcast
3 1 rainy
4 1 sunny
5 2 yes
6 3 wind
7 4 humidity
8 6 strong
9 6 weak
10 7 high
11 8 no
12 9 yes
13 10 no
14 15 yes
15 7 normal
如果任何人知道,請幫我....
我想輸出
前景
- overcast - yes - rainy - wind - strong - no - weak - yes -sunny - humidity -high -no -normal -yes
只有一個根node.then來自子節點和子子節點像..
堆棧溢出的一個方面是,一旦你發佈一個問題,如果你有額外的信息,你可以編輯你的原始問題。打開一個與你的第一個相同的新的被認爲是不好的形式。 – NotMe