I have a tree like this:
Country
|
State
____|____
/ \
City_1 City_2
______|______
/ \
Neighborhood_1 Neighborhood_2
In my database I have this records:
| path |
|------------------------------------|
| Country |
| Country.State |
| Country.State.City1 |
| Country.State.City2 |
| Country.State.City1.Neighborhood_1 |
| Country.State.City1.Neighborhood_2 |
I want to search from a path, and get all the records for any node mathing that path, excluding what is not in the matched branch, like this:
| path |
|------------------------------------|
| Country |
| Country.State |
| Country.State.City1 |
| Country.State.City1.Neighborhood_1 |