• First, let me point out that I understand "Link_Client_ID" to mean "the client of the current person" and not the other way around. In other words the first row of your sample data indicates that Diana is the client of John and not that John is the client of Diana. Read in this way, Josh is the "top" of the hierarchy and "Thabo" is the very bottom of it. Thus the various permutations are : "Josh - John - Diana," "Josh - John - Mary - Smith," and "Josh - John - Mary - Pope - Thabo."

    Having established the "up" and "down" direction, let's consider the effect of direction on the recursive query with regard to "Mary." For the recursive query that is moving down the tree from Mary to the bottom, it includes all the branches that "sprout" from the Mary node. However, for the recursive query that is moving up the tree from Mary to the top, it only includes the one branch that moves directly up from Mary to the top; it does not include any "parallel" branches.

    I guess another way to look at this is as a "family tree." When flowing down, the tree only includes descendants of Mary. When flowing up, the tree only includes the ancestors of Mary. In the family tree metaphor, Diana is a "sister" of Mary, neither a descendant nor an ancestor, and so she does not show up.

    If you want to include Diana and any other possible "sisters" or "cousins" of Mary, then what you probably want to do is a two step approach: First, starting from Mary, locate the "top" of the tree (Josh). Second, locate all of the descendants from the "top" record discovered in the first step.

    This would require two recursive CTEs: the first one looking "up" from Mary to the top of her tree, and the second one looking "down" from whatever top record was identified in the first CTE.