How to make hierarchical structure for the table

masoud_sedighy

Registered User.
Local time
Today, 09:55
Joined
Dec 10, 2011
Messages
132
I have a table with below fields and data


Code:
[FONT=&quot]DocNo                  TransmittalNo                   TransmittaltoCon[/FONT][/LEFT]
  [LEFT][FONT=&quot]Doc-0001                             tt-0002                                  con-0005[/FONT][/LEFT]
  [LEFT][FONT=&quot]Doc-0005                             tt-0002                                  con-0003[/FONT][/LEFT]
  [FONT=&quot]Doc-0001                             tt-0002                                  con-0007[/FONT][LEFT]



Now I like to make a treeview with 3 level of information of my table that level 1 is (Doc No) level 2 is (Transmittal No) and level 3 is (TransmittaltoCon) , after searching in google I read I have to make another table (query) with parent and position field for example


Code:
[FONT=&quot]ID            PARENT                                POSITION                            OPTION[/FONT][/LEFT]
  [LEFT][FONT=&quot]1              0                                              0                              DOC-0001[/FONT][/LEFT]
  [LEFT][FONT=&quot]2              1                                              0                              TT-0002[/FONT][/LEFT]
  [LEFT][FONT=&quot]3              0                                              1                              DOC-0005[/FONT][/LEFT]
  [LEFT][FONT=&quot]4              1                                              1                              CON-0007[/FONT][/LEFT]
  [LEFT][FONT=&quot]5              3                                              0                              TT-0002[/FONT][/LEFT]
  [LEFT][FONT=&quot]6              5                                              0                              CON-0003[/FONT][/LEFT]
  [LEFT]


[FONT=&quot]Please help how I have to make this query?[/FONT]​
 

Users who are viewing this thread

Back
Top Bottom