Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 13F0A9FA29D for ; Fri, 9 Feb 2007 15:24:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 80894-06 for ; Fri, 9 Feb 2007 15:24:10 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from smtp108.mail.mud.yahoo.com (smtp108.mail.mud.yahoo.com [209.191.85.218]) by postgresql.org (Postfix) with SMTP id E77969FA249 for ; Fri, 9 Feb 2007 15:24:09 -0400 (AST) Received: (qmail 74922 invoked from network); 9 Feb 2007 19:24:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=G5bWU27z5Jirs/IWcja1kYWNd5v/cR1/l5AQsJRy1lNlaLT42Bqub0I0BE4XRPlAR2Qt8/EWiK2N/VhW8Yq0RyXMdRPBKdPb+HzRW6xUIrKImR9LXYZbZvD+6C1tUVEK5x61OkAnAzL4IcsF8/wMS5MIPTTPz1NpGx8UI0Z1pQU= ; Received: from unknown (HELO ?10.90.2.103?) (burbello3000@200.103.143.8 with plain) by smtp108.mail.mud.yahoo.com with SMTP; 9 Feb 2007 19:24:07 -0000 X-YMail-OSG: UCOgTwIVM1n8a23LvnENfTfu2MQxcYFH3qavrtYAtWvPctBXJUHl3Qs6y4nnOiEKA37yPbgYCBTwc.UhOj.zsLrNBkqd6cuCJO0nQypemAk9zBKgMMbyTbEpOGVjaxvPI7GqBeKoUT6IEyrthm625w5u7rLt4aSFyuBeaEK2ocOiFYCLILjd3c9sK4zf Message-ID: <45CCCA4E.6080703@yahoo.com.br> Date: Fri, 09 Feb 2007 17:23:58 -0200 From: "Alexander B." User-Agent: Thunderbird 1.5.0.7 (X11/20060911) MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Hierarchical structure Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/132 X-Sequence-Number: 24597 Hi, I need to create a view using hierarchical structure. Let me explain how is designed the table and what's the expected result. TABLE: coo_nro integer coo_nro_father integer level integer DATA: 100 – null – 1 106 – null – 1 134 – 100 – 2 725 – 100 – 2 635 – 106 – 2 423 – 134 – 3 814 – 725 – 3 EXPECTED RESULT: 100 - 1 134 – 2 423 – 3 725 – 2 814 – 3 106 – 1 635 – 2 . . . so on Basically, my result should be this way, not necessary spaces, but sorted by hierarchic. Is this possible on Postgres? Could you help me? _______________________________________________________ Yahoo! Mail - Sempre a melhor opηγo para vocκ! Experimente jα e veja as novidades. http://br.yahoo.com/mailbeta/tudonovo/