N
N
Nikita Dergachov2018-05-19 15:30:32
SQL
Nikita Dergachov, 2018-05-19 15:30:32

How to display a certain level of nesting from a category tree?

There is a view category table id name parent_id.
It is necessary to display all categories of the 3rd level.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2018-05-19
@d-stream

Almost every example of a recursive cte just illustrates the expansion of a tree into a flat structure and at least id, parent id and nesting level appear there.
That is, the addition of any of these examples with the condition where level = N (or rather level <= N) will give the universal desired result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question