Re: Recursive use

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

 



I think it is not administration thing, but SQL language problem. PostgreSQL is SQL92 compatible and has many very good and useful addons. Generally, PostgreSQL gives You tools to analyze all, what You want, when You hava data in tables. You've explained in to short way You problem. The best is for example, to give example project of tables, relations and their contents. Without this I must build taht's all personally.
I suppose, You have to use construction:
select .... from (select ...) as foo;
or You can use views
or use cursor - first learn a little bit PLPGSQL language - it's very simple and it is the best way; You can build with PLPGSQL the function, what can return the result for You. All about PosgreSQL SQL implementation and PGPLSQL You can find in PostgreSQL doc's. I think it is very good written.

Greetings
Adam

Alexander Burbello wrote:

Hi people,

I need to know if Postgres do recursive search and how can I do!
I will explain my problem.


table COOPERATIVE
 code_cooperative int
 code_coo_father int

I can have 3 level by business rules

1 - Father
----- 2 - Children
--------- 3 - Grandchildren


I would like to have a query asking who is father and granfather
select grandfather, father from COOPERATIVE where COD_COOPERATIVE = 3

Do the Postgres can solve this problem?
Could anybody help me?

Thank you

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq





[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