related to a related field, ad infinitum
I have a company table, in which there is a company id field and a parent company id field (which is represented in another instance of the company table).
I am able to display both the company and its parent company successfully, but there are cases in which a parent company will have a parent company, and this can occur multiple times. What I would like is to display the company I'm dealing with, and whatever parent company is the top-level parent company (whether that's 1 or 4 steps away). Does that make sense?
Thanks very much for any help.