0
나는 다음과 같은 형식의 행을 반환하는 쿼리가 있습니다건물 동적 계층 구조
ID NAME PARENTID
1 Top level. 0
7 Second level1. 1
10 Third Level under Second Level1. 7
22 Second Level2. 1
23 Third Level1 under Second Level2. 22
24 Third level2 under Second Level2. 22
내가하고 싶은 것은 동적 구조를 구축합니다. 위의 데이터는 다음과 같은 계층 구조로 구성되어야합니다.
Top Level.
Second Level1.
Third Level under Second Level1.
Second Level2.
Third Level under Second Level2.
Third Level under Second Level2.
데이터는 아무 것도 될 수 없으며 계층 구조의 깊이에는 제한이 없습니다. 쿼리에서 반환 된 관계없이이 데이터를 구조체로 구성하는 프로그래밍 방식을 찾고 있습니다. ColdFusion에서이 글을 쓰고 있습니다. CF 예제가 있으면 좋지만 의사 코드는 괜찮을 것입니다. 도와 주셔서 감사합니다.