Hierarchical structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/
 



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux