How do I query in mysql for path to leaf node back to root node

532 views Asked by At

Suppose I have this table:

A hierarchical table

Now if I need to get the path to the root node from any node , how will I get that ?

Suppose I have searched for id=28, then I want to get (0,19,20) path to root node by parent_id.

Update on Abhik Chakraborty's comment: Please note that , I am not asking for any hierarchical query.

Update on Shadow's Comment : I cannot use procedure that's why I asked for help on query. Please don't answer any stored procedure.

0

There are 0 answers