Re: Ltree - how to sort nodes on parent node

From: cojack <xcojack(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Ltree - how to sort nodes on parent node
Date: 2010-04-19 18:26:59
Message-ID: hqi79i$1oel$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Alban Hertroys wrote:
>
> It would help if you'd show us what result you expect from ordering the
> above.
>
> Most people would order this by path I think. However that doesn't match
> your sort column and I can't think of any method that would give results
> in such an arbitrary order as you seem to be specifying - unless you set
> it by hand like you do.
>
> Alban Hertroys
>
> --
> Screwing up is an excellent way to attach something to the ceiling.
>
>
> !DSPAM:737,4bcc9b1e10415135793547!
>
>
>
Yes, you have right, for example I create new idea of stored data in table:

here is a paste: http://pastebin.com/4pX5cM7j -- never expired link

As you can see, I have noodes with numeric type, those nodes present a sort
position by self. And If I type ORDER BY path; I will have data like I want
to have: http://pastebin.com/R4z01LC5 -- never expired link

Again, you can see now grouped data in his nodes, this is the outputed data
I wanted. If you know better way to make this WITHOUT recursive queries,
give me a hint.

--
Regards,
cojack.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2010-04-19 21:55:01 Re: Int64GetDatum
Previous Message Alban Hertroys 2010-04-19 18:04:02 Re: Ltree - how to sort nodes on parent node