Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Quiz
10. Complex recursive CTE – trees
Summary

Instruction

Perfect! Now, let's tackle a more complex example of recursion.

Exercise

For each employee, show the following information: Id, FirstName, LastName, SuperiorId, and the path from N'Boss' (the person with a NULL SuperiorId) to that employee.

The path should start with the word N'Boss' and contain the last names of all superiors. At the end of the path, there should be the last name of the employee in question. The last names in the path should be separated with N'->'.

Example:

N'Boss->Smith->Kowalsky->Omer'