Re: another question about connectby from contrib

From: "Jan Weerts" <j(dot)weerts(at)i-views(dot)de>
To: <sector119(at)mail(dot)ru>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: another question about connectby from contrib
Date: 2003-04-23 16:19:52
Message-ID: B349BABAF9A92F4D9FBFCADF8D5FEDD505A108@ivsrv03.i-views.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2003-04-23 16:32:09 Re: [SQL] Yet Another (Simple) Case of Index not used
Previous Message Brian Piatkus 2003-04-23 16:07:55 Re: Regexps and Indices.