Sample Header Ad - 728x90

Building a tree in Apache Derby 10.10

2 votes
0 answers
242 views
I know this question has been asked probably a million times, so please forgive me asking it again. I am not a DBA and have very little knowledge of SQL and Derby, but need some kind of a solution as I am the only one responsible for getting this done: Recursive query in Apache Derby 10.10 There is a table, storing basically a tree: +----+-----------+-----+ | id | parent_id | ... | +----------------------+ | 0 | null | ... | | 5 | 0 | ... | ...................... | N | K | ... | +----+-----------+-----+ I need to make it look like this: +----+-----------+-----+ | id | parent_id | ... | +----------------------+ | 0 | null | ... | | 1 | 0 | ... | | 15 | 1 | ... | | 16 | 1 | ... | | 2 | 0 | ... | | 10 | 2 | ... | | 11 | 2 | ... | ...................... | N | K | ... | +----+-----------+-----+ Or a way to traverse and enumerate the tree in place. Thank you.
Asked by kooker (123 rep)
Sep 11, 2013, 04:08 PM