> id | parent_id | level | link | text | target | icon | node
>----+-----------+-------+------+------------+--------+------+------
> 8 | | 0 | | #3 | | | t
> 11 | 8 | 1 | | #3.1 | | | t
> 12 | 8 | 1 | | #3.2 | | | f
> 13 | 11 | 2 | | #3.1.1 | | | f
If I get this right, you have a tree represented in a table in a bfs
order (by id) and want to output a dfs order (by text)?
>#3
>#3.1
>#3.1.1
>#3.1.2
so I guess you could simply add an "ORDER BY text" clause to your query
and be done as long as you don't have any really weird locale sorting this
text column in an unintuitive manner.
HTH
Jan