Suppose I have table called tree
with id
, and parent-id
and data are b-tree
1
2 3
4 5 6 7 8 9
etc
all these are store in tree table like
1 - null
2 - 1
3 - 1
4 - 2
5 - 2
6 - 2
7 - 3
8 - 3
9 - 3
etc
so please write Query to fetch child tree of 2
output should be like
4 - 2
5 - 2
6 - 2
xx - 4
etc..