Re: Nested sort, trying again
Date: 8 Oct 2005 17:16:50 -0700
Message-ID: <1128817010.256106.274500_at_z14g2000cwz.googlegroups.com>
-CELKO- wrote:
> Frederic Brouard has a great article on using a recursive CTE to build
> the path:
>
> http://www.sqlservercentral.com/columnists/fBROUARD/recursivequeriesinsql1999andsqlserver2005.asp
Unfortunately, his example does not produce the full path, his 'path' is actually just a concatenation of (parent, child) names. One does not need a recursive query to build this kind of path, a simple self-join would suffice (pls. see 5 - Hierarchical indentation).
There is another, more serious, problem with the example. In order, "to view the data as a tree", he assigned the vehicle names in the level order which made the view possible. CTE, by itself, without the trick cannot produce such view.
I tried to post feedback on the websitte, but did not manage to register. Received on Sun Oct 09 2005 - 02:16:50 CEST