Answer the question
In order to leave comments, you need to log in
Selection - parent, ancestor, ancestor of ancestor, etc.
Good afternoon!
Immediately I apologize for the "pun" in the title and move on to the question.
There is a table:
id | parent_id | name |
---|---|---|
one | 0 | a |
2 | one | b |
3 | one | in |
4 | 3 | G |
Answer the question
In order to leave comments, you need to log in
You need to use recursive queries, but MySQL does not support them, as far as I know. Perhaps this article will help you: habrahabr.ru/blogs/sql/43955/.
Read this article explainextended.com/2009/07/20/hierarchical-data-in-mysql-parents-and-children-in-one-query/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question