title: Return all nodes in many-to-many hierarchal tree
body: <p>Similar to this question:
  <a href="https://stackoverflow.com/questions/4089144/how-do-i-query-for-all-the-nodes-between-two-nodes-in-a-tree">How do I query for all the nodes between two nodes in a tree?</a></p>
  
  <p>But I <em>do not</em> have a closure (flattened) table, a child can have many parents, and ID traversal is not necessarily in order. There is no limit to the nesting depth.</p>
  
  <p>Assume a circular reference is impossible...
  I would like to return all rows required to traverse the hierarchy.</p>
  
  <p>Assume the following table:</p>
  
  <pre><code>ParentID    ID    RowNumber(Reference)
  1           2     1
  2           4     2
  4           3     3
  3           5     4
  1           6     5
  6           7     6
  2           8     7
  3           9     8
  1           8     9
  6           8     10
  </code></pre>
  
  <p>Given <code>1</code> how would I write a single query to return all the rows (get all descendants' relationsips)?</p>
  
  <p>Likewise, given <code>2</code> I would expect rows 2,3,4,7,8</p>
  
  <p>Given <code>6</code> I would expect rows 6 and 10</p>
  
  <p>An occasional false positive is acceptable as are duplicated rows in the result. A missing row is unacceptable</p>
  
  <p>Implementing in MSAccess and SQL Server 2000+</p>