Hierarchical structure

From: "Alexander B(dot)" <burbello3000(at)yahoo(dot)com(dot)br>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Hierarchical structure
Date: 2007-02-09 19:23:58
Message-ID: 45CCCA4E.6080703@yahoo.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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/

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message imad 2007-02-09 19:53:21 Re: Hierarchical structure
Previous Message Bruno Wolff III 2007-02-09 16:28:27 Re: database encryption