You just need to write a bit of code. I have a table of offices where each office has a "parent" office. If I want to know which division or region an office is in, I simply traverse the "parent" chain recursively.
As in all recursive coding, you need to be sure that the recursion will stop eventually. Either be sure the data are absolutely clean (are they ever?) or include a loop counter to limit the process.