Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 61D3C9FB25F for ; Mon, 30 Apr 2007 11:06:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 43475-03 for ; Mon, 30 Apr 2007 11:06:38 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc2-s18.bay0.hotmail.com (bay0-omc2-s18.bay0.hotmail.com [65.54.246.154]) by postgresql.org (Postfix) with ESMTP id 913DD9FB36B for ; Mon, 30 Apr 2007 11:06:38 -0300 (ADT) Received: from hotmail.com ([64.4.54.111]) by bay0-omc2-s18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Mon, 30 Apr 2007 07:06:37 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 30 Apr 2007 07:06:36 -0700 Message-ID: Received: from 85.97.22.80 by by20fd.bay20.hotmail.msn.com with HTTP; Mon, 30 Apr 2007 14:06:33 GMT X-Originating-IP: [85.97.22.80] X-Originating-Email: [definite_ocean@hotmail.com] X-Sender: definite_ocean@hotmail.com From: "devil live" To: pgsql-sql@postgresql.org Subject: Recursive query for Product Tree Date: Mon, 30 Apr 2007 14:06:33 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 30 Apr 2007 14:06:36.0754 (UTC) FILETIME=[C411CB20:01C78B30] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.688 tagged_above=0 required=5 tests=AWL=0.779, BAYES_50=0.001, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, MSGID_FROM_MTA_HEADER=0 X-Spam-Level: ** X-Archive-Number: 200704/276 X-Sequence-Number: 28276 I have product tree for a product product_tree table : product_code, stock_code, amount_ratio 152.001.001, 151.001.001, 1 152.001.001, 150.001.001, 2 151.001.001 150.003.003, 3 151.001.001 150.009.001, 1 I need to write a query with result: 152.001.001, 150.003.003, 1 152.001.001, 150.009.001, 1 152.001.001, 150.001.001, 2 i.e. for 151 we have another node and i do not wanna see 151 here...but its ingredients.. it is kind of recursive query how can i write it ? any help? Thx in advance _________________________________________________________________ Spam filtresi ile virüslere karsi en güvenilir koruma, MSN PC Koruma'dan geçer. http://www.msn.com.tr/security/