Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Recursive query for Product Tree



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/




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group