pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: devil live <definite_ocean@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: Recursive query for Product Tree
Date: Mon, 30 Apr 2007 14:06:33 +0000
Message-ID: <BAY20-F2287862C790067221BA8B0EE4C0@phx.gbl> (raw)

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/




Message-ID: <BAY20-F2287862C790067221BA8B0EE4C0@phx.gbl>
Permalink:  ../BAY20-F2287862C790067221BA8B0EE4C0@phx.gbl/
Also on:    postgresql.org/message-id/BAY20-F2287862C790067221BA8B0EE4C0@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: definite_ocean@hotmail.com
  Subject: Re: Recursive query for Product Tree
  In-Reply-To: <BAY20-F2287862C790067221BA8B0EE4C0@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox