I have a tree table with such columns
id, name, fk_id
where the "fk_id" column references the "id" column
I need a select statement that you get all branches by id
for example:
id name fk_id
--- ----- -----
1 one 1
2 two 1
3 three 1
4 four 2
5 five 2
6 six 5
so in this case if I choose 2
the query must return 2,4,5,6
id, name, fk_id
where the "fk_id" column references the "id" column
I need a select statement that you get all branches by id
for example:
id name fk_id
--- ----- -----
1 one 1
2 two 1
3 three 1
4 four 2
5 five 2
6 six 5
so in this case if I choose 2
the query must return 2,4,5,6