I have a single table that has the Client
field and the Owner of the Client
field, so for example "Amazon UK" and "Amazon.com, Inc." respectively. What also can happen is the Owner of the Client can have a Owner also so would appear in the Client field and this can occur again and again but will eventually stop.
Example:
Client Owner of the Client
123 234
234 345
345 456
567 678
789 890
Therefore I am wondering is if recursive SQL is the best way for this? Is there also a way so it appears in separate columns for each e.g.
Client Owner of Client Owner of Client Owner of Client
123 234 345 456
567 678 NULL NULL
789 890 NULL NULL
Thanks in advance for any input on this.