Received: from mta05-svc.ntlworld.com (mta05-svc.ntlworld.com [62.253.162.45]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0FGxBV21870 for ; Tue, 15 Jan 2002 11:59:11 -0500 (EST) (envelope-from boylesa@roselink.co.uk) Received: from dualtower ([213.105.88.197]) by mta05-svc.ntlworld.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with SMTP id <20020115165915.UTWO7206.mta05-svc.ntlworld.com@dualtower>; Tue, 15 Jan 2002 16:59:15 +0000 Message-ID: <002a01c19de5$e5a8ef90$c55869d5@dualtower> From: "Steve Boyle \(Roselink\)" To: "Paulo Rodrigues" , "Wei Weng" Cc: References: <3C4430FF.30803@vianetworks.pt> <20020115114744.494618a7.wweng@kencast.com> <3C445CEE.8040505@vianetworks.pt> Subject: Re: Hierarchical queries Date: Tue, 15 Jan 2002 16:58:46 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200201/170 X-Sequence-Number: 6256 Paolo, I think this is an item on the TODO list under exotic features. (recursive unions). You could get around this using plpgsql, follow the link below for examples: http://www.brasileiro.net/postgres/cookbook/view-recipes.adp?section_id=2&fo rmat=long hih steve boyle ----- Original Message ----- From: "Paulo Rodrigues" To: "Wei Weng" Cc: Sent: Tuesday, January 15, 2002 4:46 PM Subject: Re: [SQL] Hierarchical queries > Hi Wei, > > An example would be a Bill of Materials; with Oracle I'd do > > select level, item_id, parent_id, quantity from boms start with > parent_id='A' connect by prior parent_id=item_id; > > This is what I understand for a "tree-like" query. If that's the wrong > name for it, it's my mistake, I'm sure. > > Thanks, > Paulo > > Wei Weng wrote: > > > What is a "tree-like" queries? Or you mean a query returns you a hierarchy > > structure? (Thus tree like) > > > > On Tue, 15 Jan 2002 13:39:11 +0000 > > Paulo Rodrigues wrote: > > > > > >>Hello all, > >> > >>how do you usually handle hierarchical (tree-like) queries? I'm sure > >>someone else needed this already. > >> > >>Thanks in advance, > >>Paulo > >> > >>-- > >>Paulo Rodrigues > >>Professional Services / MIS > >>prodrigues@vianetworks.pt > >> > >>VIA NET.WORKS Portugal > >>http://www.vianetworks.pt > >>local touch global reach > >>------------------------- > >>http://security.vianetworks.pt/sig/ > >> > >> > >>---------------------------(end of broadcast)--------------------------- > >>TIP 4: Don't 'kill -9' the postmaster > >> > >> > > > > > > > -- > Paulo Rodrigues > Professional Services / MIS > prodrigues@vianetworks.pt > > VIA NET.WORKS Portugal > http://www.vianetworks.pt > local touch global reach > ------------------------- > Sabe quem tem acesso à rede da sua empresa? > http://security.vianetworks.pt/sig/ > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >