I am saving data with unknown number of branches in JSON form for now and children can have unknown number of children.
example1 - {employee_1:{employee_2:{employee_3:{}}}}
example2 - {employee_3:{employee_2:employee_1:{}}, employee_4:{employee_3:{}}}
example hierarchical structure
Now to fetch this data, i have to first fetch this hierarchy saved as json and then fetch the id's stored in this json
is there any way to fetch this in one query?
or is there better approach to store and retrieve this?
i am using MySQL