In your example you are creating tables and you need to know the number and name of tables before running your code.
What if I don't know how many records initially I have in my source database?
Thank you very much for help, let me show you mine resolution which I devolped few minutes ago...
Please imagine a family (the rows where ParentID = NULL), each family can have a members which can be other family, brotheres, sisters etc...
When you put my example into tree you will have
MAIN
|-12
| |-91
|-07
|-04
| |-06
| |-02
| |-11
|-08
It will be enough...
I'am struggling with simple Parent-Child problem.
I have two columns like below
ID ParentID
MAIN
12 MAIN
07 MAIN
04 07
08 07
91 12
06 04
02 04
11 02
Now I need to achieve a correct order (Tree), unfortunatelly I am going into endless loop...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.