pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander B. <burbello3000@yahoo.com.br>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Hierarchical structure
Date: Fri, 09 Feb 2007 17:23:58 -0200
Message-ID: <45CCCA4E.6080703@yahoo.com.br> (raw)

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/
 




view thread (2+ messages)  latest in thread

Message-ID: <45CCCA4E.6080703@yahoo.com.br>
Permalink:  ../45CCCA4E.6080703@yahoo.com.br/
Also on:    postgresql.org/message-id/45CCCA4E.6080703@yahoo.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: burbello3000@yahoo.com.br
  Subject: Re: Hierarchical structure
  In-Reply-To: <45CCCA4E.6080703@yahoo.com.br>
  References: <45CCCA4E.6080703@yahoo.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox