May 31, 200520 yr I have a table with records of companies. some companies are related to others (like subsidiaries) and i want to be able to show this connection. i also want to show a connection between subsidiaries but don't want to be bogged down with manually inputting primary keys among 10 subsidiaries so that all the companies show up in each other's portals. any suggestions on how to proceed?
May 31, 200520 yr If you add a "Parent Company ID" field to the table, you can add a second TO of Company for the "Subsidiaries", where the relationship is based on Company::CompanyID = Subsidiary::Parent Company ID. To see the other companies with the same parent company, use a third TO of Company for "Same Parent", where the relationship is based on Company::Parent Company ID = Same Parent::Parent Company ID AND Company::Company ID <> Same Parent::Company ID.
June 1, 200520 yr Author so i need to give parent companies two primary keys? Company ID and Parent Company ID?
June 1, 200520 yr Company ID is the primary key, Parent Company ID is the foreign key in the self-join relationship.
Create an account or sign in to comment