Re: another question about connectby from contrib

Поиск
Список
Период
Сортировка
От Jan Weerts
Тема Re: another question about connectby from contrib
Дата
Msg-id B349BABAF9A92F4D9FBFCADF8D5FEDD505A108@ivsrv03.i-views.de
обсуждение исходный текст
Ответ на another question about connectby from contrib  (sector119@mail.ru)
Список pgsql-general
> 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


В списке pgsql-general по дате отправления:

Предыдущее
От: danwlxiv@netscape.net (Dan Wells)
Дата:
Сообщение: Searching for a guidance and a possible solution
Следующее
От: Hunter Hillegas
Дата:
Сообщение: Re: Left Join Not Using Index?