Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id ECDCF9FA646 for ; Thu, 5 Oct 2006 03:37:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 83677-09 for ; Thu, 5 Oct 2006 06:37:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ns1.peker.com.pl (181-ego-2.acn.waw.pl [62.121.85.181]) by postgresql.org (Postfix) with SMTP id EF3799FA5B4 for ; Thu, 5 Oct 2006 03:37:46 -0300 (ADT) Received: (qmail 15133 invoked by uid 540); 5 Oct 2006 06:25:21 -0000 Received: from 153.19.179.26 by ns1.peker.com.pl (envelope-from , uid 401) with qmail-scanner-1.25st (clamdscan: 0.82/760. spamassassin: 3.0.2. perlscan: 1.25st. Clear:RC:1(153.19.179.26):. Processed in 0.079234 secs); 05 Oct 2006 06:25:21 -0000 Received: from rzgw.artnet.pl (HELO ?10.4.128.107?) (informatyka-adamr@153.19.179.26) by ns1.peker.com.pl with SMTP; 5 Oct 2006 06:25:20 -0000 Message-ID: <4524A819.5020207@informatyka.gdansk.pl> Date: Thu, 05 Oct 2006 08:37:13 +0200 From: Adam Radlowski User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Alexander Burbello CC: Lista Postgres Subject: Re: Recursive use References: <4523B23A.3000506@yahoo.com.br> In-Reply-To: <4523B23A.3000506@yahoo.com.br> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.335 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/29 X-Sequence-Number: 23332 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 > >