SQL and linked list (urgent)

  • 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 example 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

     

  • Maybe it's just me, but I do not see an attached example - is it the picture link at the bottom of the post?

     

  • Dear gurus,

    I decided myself for another way. I send a query to a table and get a preselection of a data set. Then I select all fitting data by C++. After that I send a new query to a second table. Finished. That means only two queries. Thats enough for my affords.

    Best regards

    Mike888

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply