X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 73D05D1B585 for ; Thu, 29 Jan 2004 13:00:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 12569-07 for ; Thu, 29 Jan 2004 08:59:58 -0400 (AST) Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by svr1.postgresql.org (Postfix) with SMTP id 9C484D1D200 for ; Thu, 29 Jan 2004 08:59:48 -0400 (AST) Received: from unknown (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp016.mail.yahoo.com with SMTP; 29 Jan 2004 12:21:55 -0000 Message-ID: <015701c3e662$9536dcd0$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "Richard Huxton" , "psql" References: <00ad01c3e62e$b70ccf60$7502a8c0@hdsc.com> <200401291027.52174.dev@archonet.com> Subject: Re: SQL Query for Top Down fetching of childs Date: Thu, 29 Jan 2004 17:52:35 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/253 X-Sequence-Number: 16646 Thanks a lot Mr.Richard Huxton. It managed to find a similar one and modified to my need. It is working fine. Thanks a lot ----- Original Message ----- From: "Richard Huxton" To: "Kumar" ; "psql" Sent: Thursday, January 29, 2004 3:57 PM Subject: Re: [SQL] SQL Query for Top Down fetching of childs > On Thursday 29 January 2004 06:11, Kumar wrote: > > Dear Friends, > > > > Postgres 7.3.4 on RH Linux 7.2. > > > > I need a query to get the Childs of a parent (Top down analysis). Need to > > list all the departments(Childs) of a parent organization. The table > > structure is > > Two places to look for examples: > 1. the contrib/tablefunc folder has an example of this sort of thing > 2. search the mailing list articles for CONNECT BY (oracle's name for this > sort of thing) or "tree" > > -- > Richard Huxton > Archonet Ltd > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly