• @lowell,

    Thats the challenge, when you use LEFT OUTER JOIN, seq#3 will join to both seq#2 and seq#4

    In theory you have to traverse the entire tree to find out whether you can include all records. in a particular path. Short of using cursors to move records from a processed to an unprocessed state I can't see a simple method that will scale. It's not so much the SQL that I am struggling with as the actual programming concept. If I could get the stragegy I can probably write the SQL