Re: Hierarchical structure

From: imad <immaad(at)gmail(dot)com>
To: "Alexander B(dot)" <burbello3000(at)yahoo(dot)com(dot)br>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Hierarchical structure
Date: 2007-02-09 19:53:21
Message-ID: 1f30b80c0702091153u49f15ca1ycd0dbaa73f02d68a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

There is a contrib module named tablefunc. It has a function
connect_by that can do some things like this. Check if it is
sufficient for you.

--Imad
www.EnterpriseDB.com

On 2/10/07, Alexander B. <burbello3000(at)yahoo(dot)com(dot)br> wrote:
> 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/
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Daniel Medina 2007-02-09 21:20:19 tabla pg_user Ayuda......
Previous Message Alexander B. 2007-02-09 19:23:58 Hierarchical structure