N
N
nordwind20132018-08-07 18:46:23
SQL Server
nordwind2013, 2018-08-07 18:46:23

How to implement a hierarchical query?

Here is the text of the task

13.3 Write a procedure that displays all subordinates of a given salesperson, both immediate and subordinate subordinates. The function uses EmployeeID as the input parameter. As an algorithm for solving this problem, you should use the example given in Books Online and recommended by Microsoft for solving this type of problem.

I can't find this example, I only found examples with the hierarcyid type. But there are no such fields in this table. There are EmployeeID and ReportsTo fields which are the keys. Prompt beautiful implementation. Or at least working. Thank you.ZhJGZdCnvC0.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ApeCoder, 2018-08-07
@ApeCoder

Recursive cte www.sql-tutorial.ru/ru/book_recursive_cte.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question