Recursive CTE traversing a self-referencing FK with path-length and aggregate-along-path computation.