Michael Bujotzek
May 14th, 2006, 06:48 AM
:cry:
system: WinXP, SQL-Server 2K, TSQL
Dear gurus,
my task is creating a query of a table which contains information about production orders. These orders are orginized as a tree (like the explorer). That means if you have the last order of a order chain I have to chose all the previous orders which fits to the last order. The data I have is the orderID the previous orderIDprev and the master order (valid for all orders of the tree) and the nesting level of each order of the chain.
In the attached axample that means: If I know the last order MO9 I need to know the chain MO9,MO7,MO6. Do you have any ideas? A fitting SQL statement would be perfect.
Thanks in advance.
Michael
system: WinXP, SQL-Server 2K, TSQL
Dear gurus,
my task is creating a query of a table which contains information about production orders. These orders are orginized as a tree (like the explorer). That means if you have the last order of a order chain I have to chose all the previous orders which fits to the last order. The data I have is the orderID the previous orderIDprev and the master order (valid for all orders of the tree) and the nesting level of each order of the chain.
In the attached axample that means: If I know the last order MO9 I need to know the chain MO9,MO7,MO6. Do you have any ideas? A fitting SQL statement would be perfect.
Thanks in advance.
Michael