我有这样的表结构:
ID Name ParentId
-------------------------
1 Root 0
2 Business 1
3 Finance 2
4 Stock 3
5 Any 3
6 One 0
7 Two 6
有没有办法将所有关系都放在一行中?
像这样:
+------------------------------------------------------------------------------------+
|ID | NAME | ID | NAME | ID | NAME | ID | NAME |
|----------|------------|-----------|-----------|----------|---------|--------|------|
| 1 | Root | 2 | Business | 3 | Finance | 4 | Stock|
| 1 | Root | 2 | Business | 3 | Finance | 4 | Any |
| 1 | One | 6 | Two | | | | |
绝地无双
牛魔王的故事