I'm using DB2 V7 and i have a product table like below :
select * from product;
Product |Component|Quantity |Line number|
--------+---------+---------+------------
Product1|Part1 |1 |1
Product1|Product2 |2 |2
Product1|Part2 |1 |3
Product2|Part3 |4 |1
Product2|Part4 |4 |2
Product9|Part8 |5 |1
What I want is to perform a SELECT that return all child components that compose a product. The desired Query should return a result like below..
Product |Component|Quantity|Line number|BOM Level
--------+---------+--------+-----------+---------
Product1|Part1 |1 |1 |1
Product1|Part3 |8 |2 |2
Product1|Part4 |8 |3 |2
Product1|Part2 |1 |4 |1
Product2|Part3 |4 |1 |1
Product2|Part4 |4 |2 |1
Product9|Part8 |5 |1 |1
4
in resultset is taken from?