Archive for March 3rd, 2009
From Stack Overflow:
Let’s say that we have we have a table with the classic
Users (user_id int, manager_id int)(refers to
If you randomly select 2 rows in the table, or 2 nodes, how do you find the lowest level common ancestor? My platform is SQL Server 2005 (Transact-SQL), but any ANSI compliant SQL will also work…
Very nice question.
This may be useful to check against any kind of common ancestry in a tree structure: classes, folders, etc.
Read the rest of this entry »