[SQL] recursive query

2007-09-05 Thread Joel Fradkin
Hi, I am trying to do a hierarchy design. We currently have it hard coded to 4 levels and the location table has an id field for each level where the data has a location id. This allows easy access by level (to restrict who see what) and easy to arrogate for reporting by division, region, distric

[SQL] Recursive query for Product Tree

2007-04-30 Thread devil live
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.

[SQL] Recursive query to be used in another result ?

2005-01-12 Thread Bradley Miller
I need some help on the following problem. I have an account info table that has a hierarchy of accounts. The grouping goes from end user to organization to reseller. I have a PL/SQL function written that gives me the tree, so I just whittle it down by selecting the one id for a reseller: selec

[SQL] Recursive Query (need of PL/pgSQL?)

2001-02-23 Thread Stephan Richter
Hello everyone, I have a system (simplified for this example) with the following two tables: TABLE1 id::int8 containerId::int8 containerType::varchar(100) moreInfo::text TABLE2 id::int8 containerId::int8 containerType::varchar(100) otherInfo::text