Single-table database query tree

To determine whether the parent node by is_parent, and if so, by parent_id id and check out all the child nodes, otherwise, the query itself. 

Guess you like

Origin blog.csdn.net/vandet100/article/details/83511504