Query to move mysql tree

I developed a border list model diagram in mysql. I found the same procedure at http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html to traverse the tree.

But I need a specific query that asked three random nodes that I will find out if they are part (subpath) of the descendant path in the general tree.

Could you help me? Thank you

+3
source share
1 answer

You need to create a function "has_parent (this_node, look_for)" that recursively (i.e. by itself) queries the tree to solve the problem.

0
source

Source: https://habr.com/ru/post/1794484/


All Articles