Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A2E26632D2A for ; Mon, 19 Apr 2010 15:38:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60705-02 for ; Mon, 19 Apr 2010 18:38:14 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 4980E632B9E for ; Mon, 19 Apr 2010 15:38:14 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id o3JIcCFM062251 for ; Mon, 19 Apr 2010 15:38:12 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id o3JIQxXt057817 for pgsql-general@postgresql.org; Mon, 19 Apr 2010 15:26:59 -0300 (ADT) (envelope-from news) From: cojack X-Newsgroups: pgsql.general Subject: Re: Ltree - how to sort nodes on parent node Followup-To: pgsql.general Date: Mon, 19 Apr 2010 20:26:59 +0200 Organization: Aichra.pl Lines: 35 Message-ID: References: Reply-To: xcojack@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@news.hub.org User-Agent: KNode/4.4.2 To: pgsql-general@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.801 tagged_above=-10 required=5 tests=BAYES_50=0.8, FREEMAIL_FROM=0.001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201004/623 X-Sequence-Number: 161821 > 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.